fix: prevent waiting for the session to load from history
This commit is contained in:
parent
123a67cddb
commit
9fcc332a99
1 changed files with 12 additions and 12 deletions
|
|
@ -105,25 +105,25 @@ export const loadSession = createAsyncThunk<
|
|||
ThunkApiType
|
||||
>(
|
||||
"session/load",
|
||||
async (
|
||||
{ sessionId, saveCurrentSession: save },
|
||||
{ extra, dispatch, getState },
|
||||
) => {
|
||||
async ({ sessionId, saveCurrentSession: save }, { extra, dispatch }) => {
|
||||
if (save) {
|
||||
const result = await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: false,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
unwrapResult(result);
|
||||
// save the session in the background
|
||||
void (async () => {
|
||||
const result = await dispatch(
|
||||
saveCurrentSession({
|
||||
openNewSession: false,
|
||||
generateTitle: true,
|
||||
}),
|
||||
);
|
||||
unwrapResult(result);
|
||||
})();
|
||||
}
|
||||
const session = await getSession(extra.ideMessenger, sessionId);
|
||||
dispatch(newSession(session));
|
||||
|
||||
// Restore selected chat model from session, if present
|
||||
if (session.chatModelTitle) {
|
||||
dispatch(selectChatModelForProfile(session.chatModelTitle));
|
||||
void dispatch(selectChatModelForProfile(session.chatModelTitle));
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue