Skip to content

Commit 021f761

Browse files
committed
Retry embed token check
1 parent 132ab9d commit 021f761

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

web/src/components/common/Auth.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ const Auth = () => {
182182
const currentEmail = useSelector((state: RootState) => state.settings.currentEmail)
183183

184184
useEffect(() => {
185+
let tries = 1
185186
const checkToken = async () => {
186187
const mx_token = await getMXToken()
187188

@@ -198,10 +199,14 @@ const Auth = () => {
198199
email,
199200
}))
200201
dispatch(setCurrentEmail(email))
202+
return
201203
} catch (error) {
202204
console.error('Failed to authenticate embed token:', error)
203205
}
204206
}
207+
if (tries < 3) {
208+
setTimeout(checkToken, (tries++) * 1000)
209+
}
205210
}
206211
if (isEmbedded) {
207212
checkToken()

0 commit comments

Comments
 (0)