mirror of
https://github.com/jackhh66/ChatGPT_Web_accessToken.git
synced 2026-12-03 21:29:32 +00:00
feat: 侧边栏切换取消上次请求
This commit is contained in:
1 parent
d2ae2c4f54
commit
4458e744cc
4 files changed
+40
-24
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import type { HistoryState } from './helper'
|
||||
import { getLocalHistory, setLocalHistory } from './helper'
|
||||
|
||||
export const useHistoryStore = defineStore('history-store', {
|
||||
state: (): HistoryState => getLocalHistory(),
|
||||
getters: {
|
||||
@@ -65,6 +64,8 @@ export const useHistoryStore = defineStore('history-store', {
|
||||
},
|
||||
|
||||
chooseHistory(index: number) {
|
||||
if (this.active === index)
|
||||
return
|
||||
this.active = index
|
||||
setLocalHistory(this.$state)
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user