letsgooooo receiving calls

This commit is contained in:
m5r
2022-06-15 01:28:32 +02:00
parent d452422355
commit a46a4a3861
11 changed files with 527 additions and 172 deletions

View File

@ -78,7 +78,7 @@ export default function useNotifications() {
function urlBase64ToUint8Array(base64String: string) {
const padding = "=".repeat((4 - (base64String.length % 4)) % 4);
const base64 = (base64String + padding).replace(/\-/g, "+").replace(/_/g, "/");
const base64 = (base64String + padding).replaceAll("-", "+").replaceAll("_", "/");
const rawData = window.atob(base64);
const outputArray = new Uint8Array(rawData.length);

View File

@ -19,7 +19,7 @@ export default function useNotifications() {
channel.removeEventListener("message", eventHandler);
channel.close();
};
}, []);
}, [setNotificationData]);
useEffect(() => {
if (!notificationData) {
@ -28,7 +28,7 @@ export default function useNotifications() {
const timeout = setTimeout(() => setNotificationData(null), 5000);
return () => clearTimeout(timeout);
}, [notificationData]);
}, [notificationData, setNotificationData]);
}
export const notificationDataAtom = atom<NotificationPayload | null>(null);