fix pargar and login

This commit is contained in:
2026-08-01 14:04:26 +03:30
parent 5b0bb45e52
commit 0cd3772517
5 changed files with 227 additions and 71 deletions
+15 -3
View File
@@ -94,6 +94,7 @@ import { getDisplayAppVersion } from '@/config/config-cache'
import { computed, defineAsyncComponent, h, onMounted, ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import { message } from 'ant-design-vue'
import { showBrowserNotification } from '@/utils/browserNotification'
import img_topGradiant from '@/views/login/assets/img/gr_top_white.svg'
import img_pattern from '@/views/login/assets/img/pattern.svg'
import { LoadingOutlined } from '@ant-design/icons-vue'
@@ -231,9 +232,20 @@ watch(latestIncomingNotification, (payload) => {
if (!payload) return
if (payload.at === lastSupportToastAt) return
lastSupportToastAt = payload.at
message.info({
content: `پیام جدید پشتیبانی: ${payload.body}`,
duration: 3,
// فقط وقتی خارج از صفحهٔ چت (گیت داخل chat.ts)؛ داخل چت نوتیف نمی‌آید
if (typeof document === 'undefined' || document.visibilityState === 'visible') {
message.info({
content: `پیام جدید پشتیبانی: ${payload.body}`,
duration: 3,
})
}
void showBrowserNotification({
title: payload.title || 'پشتیبانی',
body: payload.body || 'پیام جدید',
tag: 'support-chat-message',
url: '/support',
})
})