This commit is contained in:
zadit
2024-11-08 13:50:03 +07:00
parent 32e8ebd69b
commit bea0ff63d7
9 changed files with 270 additions and 26 deletions

View File

@@ -208,6 +208,15 @@ function App() {
});
});
const checkNotifications = () => {
let permission = Notification.permission;
// Check current permission
if (permission !== "granted") {
setModal("req_notification");
}
};
socket.on("checkUserTokenRes", async (data) => {
if (data.status !== 200) {
removeLocalStorage("auth");
@@ -226,7 +235,7 @@ function App() {
console.log("getting guest side");
setDeviceType("clerk");
// checkNotifications(data.data.user.userId);
checkNotifications();
} else {
setDeviceType("guestDevice");
}
@@ -315,6 +324,7 @@ function App() {
navigate({ search: queryParams.toString() }, { replace: true });
}
};
// useEffect(() => {
// const askNotificationPermission = async () => {
// let permission = Notification.permission;