* perf: 新增会话添加在列表前方

* fix: 路由模式改为 hash 保证兼容性

* perf: 增强移动端体验

* chore: version 2.5.1
This commit is contained in:
Redon
2023-02-21 08:57:54 +08:00
committed by GitHub
parent cb90d81c69
commit 4ab9f709de
9 changed files with 33 additions and 17 deletions

View File

@@ -17,8 +17,8 @@ export const useChatStore = defineStore('chat-store', {
actions: {
addHistory(history: Chat.History, chatData: Chat.Chat[] = []) {
this.history.push(history)
this.chat.push({ uuid: history.uuid, data: chatData })
this.history.unshift(history)
this.chat.unshift({ uuid: history.uuid, data: chatData })
this.active = history.uuid
this.reloadRoute(history.uuid)
},
@@ -63,9 +63,9 @@ export const useChatStore = defineStore('chat-store', {
}
},
setActive(uuid: number) {
async setActive(uuid: number) {
this.active = uuid
this.reloadRoute(uuid)
return await this.reloadRoute(uuid)
},
addChatByUuid(uuid: number, chat: Chat.Chat) {