diff --git a/src/components/AppBar.vue b/src/components/AppBar.vue index 8b084c3..5f7f66e 100644 --- a/src/components/AppBar.vue +++ b/src/components/AppBar.vue @@ -72,6 +72,18 @@ const chats = computed(() => { }); chatStore.getChats(); +let waitUpdate = false; +chatStore.$subscribe(() => { + if (waitUpdate) { + return; + } + waitUpdate = true; + setTimeout(() => { + chatStore.getChats(); + waitUpdate = false; + }, 1000); +}); + // 恼 // setInterval(() => { // chats.value.data = chatStore.chats.data diff --git a/src/pages/chats/[id]/index.vue b/src/pages/chats/[id]/index.vue index 4e05ab9..2a679e0 100644 --- a/src/pages/chats/[id]/index.vue +++ b/src/pages/chats/[id]/index.vue @@ -22,8 +22,13 @@ - - +
+ +
+ +
+ +