支持在 Chat 页面显示,隐藏对话列表

This commit is contained in:
RockYang
2025-01-06 19:17:18 +08:00
parent cffc722622
commit 7da5b7163c
27 changed files with 404 additions and 393 deletions

View File

@@ -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;