mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-12-26 18:15:57 +08:00
支持在 Chat 页面显示,隐藏对话列表
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { defineStore } from "pinia";
|
||||
import {defineStore} from "pinia";
|
||||
import Storage from "good-storage";
|
||||
|
||||
export const useSharedStore = defineStore("shared", {
|
||||
@@ -9,6 +9,7 @@ export const useSharedStore = defineStore("shared", {
|
||||
socket: { conn: null, handlers: {} },
|
||||
theme: Storage.get("theme", "light"),
|
||||
isLogin: false,
|
||||
chatListExtend: Storage.get("chat_list_extend", true),
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
@@ -29,6 +30,10 @@ export const useSharedStore = defineStore("shared", {
|
||||
}
|
||||
this.socket.conn = value;
|
||||
},
|
||||
setChatListExtend(value) {
|
||||
this.chatListExtend = value;
|
||||
Storage.set("chat_list_extend", value);
|
||||
},
|
||||
addMessageHandler(key, callback) {
|
||||
if (!this.socket.handlers[key]) {
|
||||
this.socket.handlers[key] = callback;
|
||||
|
||||
Reference in New Issue
Block a user