Created
September 12, 2020 19:33
-
-
Save jasonLaster/6fdd96d3e110c73a8c8deed23aa7cf36 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/ui/actions/metadata.js b/src/ui/actions/metadata.js | |
| index ad775723..f0c4140c 100644 | |
| --- a/src/ui/actions/metadata.js | |
| +++ b/src/ui/actions/metadata.js | |
| @@ -179,5 +179,12 @@ export function updateUser(authUser = {}) { | |
| const updatedUser = { id, avatarID, picture, name }; | |
| dispatch({ type: "register_user", user: updatedUser }); | |
| + | |
| + if (authUser) { | |
| + try { | |
| + const recordings = await ThreadFront.getRecordings(auth.user.sub) | |
| + setRecordings(recordings); | |
| + } catch (e) {} | |
| + } | |
| }; | |
| } | |
| diff --git a/src/ui/components/Avatar.js b/src/ui/components/Avatar.js | |
| index eb3bdee5..c39955b2 100644 | |
| --- a/src/ui/components/Avatar.js | |
| +++ b/src/ui/components/Avatar.js | |
| @@ -24,11 +24,8 @@ const Avatar = props => { | |
| let auth = useAuth0(); | |
| useEffect(() => { | |
| - if (auth.user) { | |
| - sendUserToBrowser(auth.user); | |
| - updateUser(auth.user); | |
| - app.threadFront.getRecordings(auth.user.sub).then(recordings => setRecordings(recordings)); | |
| - } | |
| + sendUserToBrowser(auth.user); | |
| + updateUser(auth.user); | |
| }, [auth.user]); | |
| if (auth.isAuthenticated && isFirstPlayer) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment