mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-11 20:43:42 +08:00
使用函数式的风格访问状态库
This commit is contained in:
@@ -131,9 +131,9 @@ export const useChatStore = create<ChatStore>()(
|
||||
},
|
||||
|
||||
removeSession(index: number) {
|
||||
set(() => {
|
||||
let selectedIndex = get().currentSessionIndex;
|
||||
const sessions = get().sessions;
|
||||
set((state) => {
|
||||
let selectedIndex = state.currentSessionIndex;
|
||||
const sessions = state.sessions;
|
||||
|
||||
if (sessions.length === 1) {
|
||||
return {
|
||||
|
Reference in New Issue
Block a user