Skip to content

Commit

Permalink
Improve code legibility a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
RickDT committed Oct 5, 2023
1 parent 83920e4 commit ffd4698
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions examples/react-webpack/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ const ProfileBox = () => {

useEffect(() => {
// if the user is now connected, then fetch profile info
if (loginStatus?.status === 'connected') getProfile?.().then(setProfileResponse)
}, [loginStatus])
if (loginStatus?.status === 'connected' && getProfile) {
getProfile().then(setProfileResponse)
}
}, [loginStatus, getProfile])

if (!profileResponse) return null

Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ export const useParallel = () => {
}

// if we haven't loaded, return empty object
if (!parallel)
if (!parallel) {
return {
isLoaded: false,
}

}
// React recreates elements on render/re-render, causing any children iframe elements
// to reload their src attribute which causes a reload of the Parallel experience within
// the iframe - which is a bad experience for users
Expand Down

0 comments on commit ffd4698

Please sign in to comment.