mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix: notification count still displays when closing alert #51
This commit is contained in:
@@ -36,7 +36,7 @@ const isLogin = ref<boolean>(false)
|
||||
const unReadMessage = reactive<UnReadMessage | {}>(
|
||||
{},
|
||||
) as UnwrapNestedRefs<UnReadMessage>
|
||||
const unReadDm = reactive<UnReadDm | {}>({} as UnwrapNestedRefs<UnReadDm>)
|
||||
const unReadDm = reactive<UnReadDm>({} as UnwrapNestedRefs<UnReadDm>)
|
||||
const unReadMessageCount = ref<number>(0)
|
||||
const newMomentsCount = ref<number>(0)
|
||||
|
||||
@@ -162,9 +162,7 @@ async function getUnreadMessageCount() {
|
||||
})
|
||||
if (res.code === 0) {
|
||||
Object.assign(unReadDm, res.data)
|
||||
Object.entries(unReadDm).forEach(([, value]) => {
|
||||
unReadMessageCount.value += typeof value === 'number' ? value : 0
|
||||
})
|
||||
unReadMessageCount.value += unReadDm.follow_unread
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
@@ -61,7 +61,7 @@ export default defineComponent({
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
const resData = res.data
|
||||
this.list[4].unreadCount = parseInt(resData.unfollow_unread) + parseInt(resData.follow_unread)
|
||||
this.list[4].unreadCount = resData.follow_unread
|
||||
}
|
||||
}).catch(() => {
|
||||
this.list[4].unreadCount = 0
|
||||
|
||||
Reference in New Issue
Block a user