Skip to content

Commit

Permalink
fix issue to get the initial user accountId
Browse files Browse the repository at this point in the history
  • Loading branch information
wpdas committed Apr 18, 2023
1 parent 66807c6 commit aa095e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-social-bridge",
"version": "1.3.2",
"version": "1.3.3",
"description": "This library allows you to create a common application using ReactJS and inject it in a controlled way into a Widget on Near Social. Therefore, the Widget talks to the React application and vice versa, making it possible to consume Discovery API resources within the React application.",
"main": "./dist/cjs/index.js",
"module": "./index.js",
Expand Down
12 changes: 6 additions & 6 deletions src/auth/contexts/AuthProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children }) =>

// Fetch user info
useEffect(() => {
// Set the initial user info
const preUserInfo = getConnectionPayload().userInfo
if (preUserInfo) {
setUser(preUserInfo)
}

const onConnectHandler = () => {
// Set the initial user info
const preUserInfo = getConnectionPayload().userInfo
if (preUserInfo) {
setUser(preUserInfo)
}

onConnectObservable.unsubscribe(onConnectHandler)
fetchUserInfo()
}
Expand Down

0 comments on commit aa095e4

Please sign in to comment.