Skip to content

Commit

Permalink
fix: issue with loading not finishing
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Dec 8, 2023
1 parent 03bf419 commit 1320a45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
18 changes: 5 additions & 13 deletions src/components/auth/LoginModal/LoginModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,8 @@ export const LoginContent = ({ setCurrentState }: ContentProps) => {
<div className={cx('flex flex-col gap-4 pb-4')}>
<Button
onClick={() => {
console.log(`${getCurrentUrlWithoutQuery()}?login=x`)
signIn('twitter', {
callbackUrl: `${getCurrentUrlWithoutQuery().replace(
'http://localhost:3000',
''
)}?login=x`,
callbackUrl: `${getCurrentUrlWithoutQuery()}?login=x`,
})
}}
size='lg'
Expand Down Expand Up @@ -366,15 +362,11 @@ const XLoginLoading = ({ closeModal, setCurrentState }: ContentProps) => {

const upsertedProfile = useRef(false)
useEffect(() => {
const foundIdentity = linkedIdentity?.externalId === session?.user?.id
console.log(
linkedIdentity,
session?.user,
foundIdentity,
upsertedProfile.current
)
const foundIdentity =
linkedIdentity &&
session &&
linkedIdentity?.externalId === session?.user?.id
if (foundIdentity && !upsertedProfile.current) {
console.log('CALLING UPSERTING')
upsertedProfile.current = true
upsertProfile({
content: {
Expand Down
3 changes: 0 additions & 3 deletions src/services/datahub/identity/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ export function useDatahubIdentitySubscriber() {

const listener = () => {
if (document.visibilityState === 'visible') {
console.log('subscription')
unsubRef.current = subscription(queryClient)
} else {
if (
useSubscriptionState.getState().subscriptionState['identity'] ===
'dynamic'
) {
console.log('unsub')
unsubRef.current?.()
}
}
Expand Down Expand Up @@ -66,7 +64,6 @@ function subscription(queryClient: QueryClient) {
{
complete: () => undefined,
next: async (data) => {
console.log('SUB DATA', data)
const eventData = data.data?.linkedIdentity
if (!eventData) return

Expand Down

0 comments on commit 1320a45

Please sign in to comment.