Skip to content

Commit bd48ea3

Browse files
committed
add another check for ssoFlow and source before changing the state
1 parent e489714 commit bd48ea3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/webviews/src/index.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ document.addEventListener('DOMContentLoaded', () => {
9090
processOauthCallback(message.data as CloudAuthResponse)
9191
break
9292
case VscodeMessageAction.OpenOAuthSsoDialog:
93-
useOAuthStore.getState().setSSOFlow(message.data?.ssoFlow)
94-
useOAuthStore.getState().setSocialDialogState(message.data?.source || null)
93+
const { source, ssoFlow } = message.data ?? {}
94+
if (ssoFlow && source) {
95+
const state = useOAuthStore.getState()
96+
state.setSSOFlow(ssoFlow)
97+
state.setSocialDialogState(source)
98+
}
9599
break
96100
default:
97101
break

0 commit comments

Comments
 (0)