try catch loadLastSession
This commit is contained in:
parent
a58ddfa175
commit
0122c6bee8
1 changed files with 8 additions and 1 deletions
|
|
@ -159,7 +159,14 @@ export const loadLastSession = createAsyncThunk<void, void, ThunkApiType>(
|
|||
return;
|
||||
}
|
||||
|
||||
const session = await getSession(extra.ideMessenger, lastSessionId);
|
||||
let session: Session;
|
||||
try {
|
||||
session = await getSession(extra.ideMessenger, lastSessionId);
|
||||
} catch {
|
||||
// retry again after 1 sec
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
session = await getSession(extra.ideMessenger, lastSessionId);
|
||||
}
|
||||
dispatch(newSession(session));
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue