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