mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 12:57:25 +08:00
fix: #589 improve unauthorized tips
This commit is contained in:
@@ -333,17 +333,23 @@ export const useChatStore = create<ChatStore>()(
|
||||
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)),
|
||||
),
|
||||
}));
|
||||
},
|
||||
},
|
||||
});
|
||||
5000,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user