forked from XiaoMo/ChatGPT-Next-Web
fix: hide toast on cancel session deletion on mobile
This commit is contained in:
parent
f83859113e
commit
71d9fbc367
@ -332,18 +332,19 @@ export const useChatStore = create<ChatStore>()(
|
||||
const isLastSession = get().sessions.length === 1;
|
||||
if (!isMobileScreen() || confirm(Locale.Home.DeleteChat)) {
|
||||
get().removeSession(index);
|
||||
|
||||
showToast(Locale.Home.DeleteToast, {
|
||||
text: Locale.Home.Revert,
|
||||
onClick() {
|
||||
set((state) => ({
|
||||
sessions: state.sessions
|
||||
.slice(0, index)
|
||||
.concat([deletedSession])
|
||||
.concat(state.sessions.slice(index + Number(isLastSession))),
|
||||
}));
|
||||
},
|
||||
});
|
||||
}
|
||||
showToast(Locale.Home.DeleteToast, {
|
||||
text: Locale.Home.Revert,
|
||||
onClick() {
|
||||
set((state) => ({
|
||||
sessions: state.sessions
|
||||
.slice(0, index)
|
||||
.concat([deletedSession])
|
||||
.concat(state.sessions.slice(index + Number(isLastSession))),
|
||||
}));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
currentSession() {
|
||||
|
Loading…
Reference in New Issue
Block a user