chore: message page list support sharedworker.js

This commit is contained in:
duorameng
2026-05-09 09:02:43 +08:00
parent f5f761e7ef
commit 0dad9dd541
7 changed files with 56 additions and 3 deletions
@@ -19,6 +19,8 @@ import {
AlertDialogTitle,
} from '@/components/ui/alert-dialog'
import { useSiteSettings } from '@/composables/useSiteSettings'
import { useEventBus } from '@/composables/useEventBus'
import { LOG_EVENTS } from '@/constants'
import BaihuDialog from '@/components/ui/BaihuDialog.vue'
const props = defineProps<{
@@ -94,6 +96,15 @@ onMounted(() => {
fetchLogs()
})
// 实时更新:当有新推送产生且用户在第一页时刷新
useEventBus([LOG_EVENTS.ADDED], (payload) => {
if (payload && payload.category === LOG_CATEGORY.PUSH_LOG) {
if (currentPage.value === 1) {
fetchLogs()
}
}
})
const selectedLog = computed(() => logs.value.find((l: AppLog) => l.id === selectedLogId.value))
defineExpose({