Skip to content

Commit 0122c6b

Browse files
committed
try catch loadLastSession
1 parent a58ddfa commit 0122c6b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

gui/src/redux/thunks/session.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,14 @@ export const loadLastSession = createAsyncThunk<void, void, ThunkApiType>(
159159
return;
160160
}
161161

162-
const session = await getSession(extra.ideMessenger, lastSessionId);
162+
let session: Session;
163+
try {
164+
session = await getSession(extra.ideMessenger, lastSessionId);
165+
} catch {
166+
// retry again after 1 sec
167+
await new Promise((resolve) => setTimeout(resolve, 1000));
168+
session = await getSession(extra.ideMessenger, lastSessionId);
169+
}
163170
dispatch(newSession(session));
164171
},
165172
);

0 commit comments

Comments
 (0)