diff --git a/src/App.vue b/src/App.vue
index 0f0c3f1..2e2a829 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -7,12 +7,11 @@
-
+
-{{not}}
-
+
@@ -22,23 +21,30 @@ import OverlayView from "@/components/OverlayView.vue";
import ToolBar from "@/components/ToolBar.vue";
import Button from "primevue/button";
import axiosSetup from "@/services/axiosSetup";
-import {onMounted, ref} from "vue";
+import {computed, onMounted, ref} from "vue";
import {subscribeUserToPush} from "@/services/pushManager";
import apiClient from '@/services/axiosSetup';
+const checkNotif = computed(() => {
+ return 'Notification' in window && Notification.permission === 'default'
+})
-const not = ref(Notification.permission)
-const checkSubscribe = async () => {
- if (Notification.permission === 'default') {
- await Notification.requestPermission().then(sendSubscribe)
- } else if (Notification.permission === 'granted') {
- await sendSubscribe()
+const checkSubscribe = async () => {
+ if ("Notification" in window) {
+ if (Notification.permission === 'default') {
+ await Notification.requestPermission().then(sendSubscribe)
+ } else if (Notification.permission === 'granted') {
+ await sendSubscribe()
+ } else {
+ // Пользователь ранее отклонил запрос
+ }
} else {
- // Пользователь ранее отклонил запрос
+ console.log("Notification API is not supported in this browser.");
+ // You may want to use an alternative method, like alerts or modals
}
}
-const sendSubscribe = async () => {
+const sendSubscribe = async () => {
try {
const subscription = await subscribeUserToPush();
console.log("Push subscription:", subscription);
@@ -51,7 +57,7 @@ const sendSubscribe = async () => {
}
onMounted(async () => {
- await checkSubscribe()
+ await checkSubscribe()
})
diff --git a/src/components/ToolBar.vue b/src/components/ToolBar.vue
index ec3ddb8..4515767 100644
--- a/src/components/ToolBar.vue
+++ b/src/components/ToolBar.vue
@@ -76,6 +76,7 @@
Настройки
+
@@ -101,7 +102,9 @@ const transactionType = ref()
const categoryType = ref()
const drawerOpened = ref(false);
-
+const refreshPage = () => {
+ window.location.reload(true)
+}
const openDrawer = (selectedTransactionType = null, selectedCategoryType = null) => {
if (selectedTransactionType && selectedCategoryType) {
transactionType.value = selectedTransactionType;
diff --git a/src/components/budgets/BudgetCategoryView.vue b/src/components/budgets/BudgetCategoryView.vue
index b03ddc8..af385f8 100644
--- a/src/components/budgets/BudgetCategoryView.vue
+++ b/src/components/budgets/BudgetCategoryView.vue
@@ -71,8 +71,10 @@ watch(
-
+
diff --git a/src/components/budgets/BudgetView.vue b/src/components/budgets/BudgetView.vue
index ccb97b7..7e20df0 100644
--- a/src/components/budgets/BudgetView.vue
+++ b/src/components/budgets/BudgetView.vue
@@ -96,23 +96,23 @@
-