notification-store now saves wether the applications tab is focussed
This commit is contained in:
15
src/main.ts
15
src/main.ts
@@ -6,6 +6,7 @@ import App from './App.vue';
|
||||
import Keycloak from 'keycloak-js';
|
||||
import {useUserStore} from 'stores/user-store';
|
||||
import { useChatStore } from 'stores/chat-store';
|
||||
import { useNotificationStore } from './stores/notification-store';
|
||||
|
||||
const app = createApp(App);
|
||||
const pinia = createPinia();
|
||||
@@ -52,10 +53,24 @@ userStore.initKeycloak()
|
||||
chatStore.loadProfilePictures();
|
||||
userStore.loadProfilePictures();
|
||||
|
||||
Notification.requestPermission().then((result) => {
|
||||
useNotificationStore().saveDecision(result === "granted");
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
console.error("hier ist was schlimmes passiert menno");
|
||||
}
|
||||
}).catch(e=>console.error(e));
|
||||
|
||||
|
||||
window.onfocus = function() {
|
||||
useNotificationStore().isTabActive = true;
|
||||
}
|
||||
|
||||
window.onblur = function() {
|
||||
useNotificationStore().isTabActive = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user