fix icons
All checks were successful
Build frontend / build (push) Successful in 1m27s

This commit is contained in:
hamzaobed7
2026-08-10 22:27:28 +03:00
parent 1fa2fabb38
commit 9d3d02c88a
4 changed files with 20 additions and 16 deletions

View File

@ -1,11 +1,11 @@
"use client";
import { useEffect, useState, useRef } from "react";
import { initializeApp, getApps } from "firebase/app";
import { getMessaging, getToken, onMessage } from "firebase/messaging";
import AuthService from "../services/AuthService";
import { setFCMToken } from "../utils/api";
//فاير بيز
const firebaseConfig = {
apiKey: "AIzaSyBZV7KBLRJSTApahfrO8lBesmIM3zNRSaY",
authDomain: "sweet-home-b2766.firebaseapp.com",
@ -16,6 +16,7 @@ const firebaseConfig = {
measurementId: "G-M2V95NBJLX",
};
//عم نعمل تهيئة للاعدادات
const app = getApps().length === 0 ? initializeApp(firebaseConfig) : getApps()[0];
export default function NotificationHandler() {
@ -26,11 +27,10 @@ export default function NotificationHandler() {
useEffect(() => {
function checkAuth() {
if (initialized.current) return;
if (!AuthService.getToken()) return;
initialized.current = true;
if ("Notification" in window) {
//عم نشوف اذا حط سماح او رفض
if (Notification.permission === "default") {
setShowPrompt(true);
} else if (Notification.permission === "granted") {