Эх сурвалжийг харах

feat: 取消置为已读功能注释

jack 5 сар өмнө
parent
commit
cf6b8b541d

+ 2 - 1
src/auto-imports.d.ts

@@ -3,6 +3,7 @@
 // @ts-nocheck
 // noinspection JSUnusedGlobalSymbols
 // Generated by unplugin-auto-import
+// biome-ignore lint: disable
 export {}
 declare global {
   const $api: typeof import('@/api/index')['default']
@@ -68,6 +69,6 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }

+ 8 - 8
src/stores/modules/notificationMessage.ts

@@ -49,15 +49,15 @@ export const useNotificationMessage = defineStore('notificationMessage', {
     async markMessageAsRead() {
       if (this.readCardMap.length === 0) return
 
-      // await $api.setMessageRead({ id: this.readCardMap }).then((res) => {
-      //   if (res.code === 200) {
-      //     this.readCardMap = []
-      //     localStorage.setItem('readCardMap', JSON.stringify(this.readCardMap))
+      await $api.setMessageRead({ id: this.readCardMap }).then((res) => {
+        if (res.code === 200) {
+          this.readCardMap = []
+          localStorage.setItem('readCardMap', JSON.stringify(this.readCardMap))
 
-      //     // 在将消息标记为已读后,再次检查是否有新消息
-      //     this.hasUnreadMessages()
-      //   }
-      // })
+          // 在将消息标记为已读后,再次检查是否有新消息
+          this.hasUnreadMessages()
+        }
+      })
     },
     clearData() {
       this.notificationMsgList = []