diff --git a/src/App.vue b/src/App.vue
index 5c6d55e..e744a86 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -7,6 +7,7 @@
+ {{ tg_id }}
@@ -24,9 +25,19 @@ import {subscribeUserToPush} from "@/services/pushManager";
import apiClient from '@/services/axiosSetup';
const checkNotif = computed(() => {
- return 'Notification' in window && Notification.permission === 'default'
+
+ return !!tg_id.value && 'Notification' in window && Notification.permission === 'default'
})
+const tg_id = computed(() => {
+ if (window.Telegram?.WebApp) {
+ const tg = window.Telegram.WebApp;
+ tg.expand(); // Разворачиваем приложение на весь экран
+ return tg.initDataUnsafe.user?.id ?? null; // Если tg_id нет, возвращаем null
+ }
+ return null;
+});
+
const checkSubscribe = async () => {
if ("Notification" in window) {
if (Notification.permission === 'default') {