feat: sound on browser push notification (#18548)
* feat: sound on notification * refactor: add load audio * chore: remove * fix: type error * fix: notification * fix: prevent multiple initialization = * feat: create notification page * chore: update the mp3 file
This commit is contained in:
1 parent
4daad2ac08
commit
b0125e1a05
16 files changed
+416
-237
No files matched your search
+8
-11
@@ -1,9 +1,10 @@
|
||||
import type { IncomingMessage } from "http";
|
||||
import { SessionProvider } from "next-auth/react";
|
||||
import type { AppContextType } from "next/dist/shared/lib/utils";
|
||||
import React, { useEffect } from "react";
|
||||
import React from "react";
|
||||
import CacheProvider from "react-inlinesvg/provider";
|
||||
|
||||
import { WebPushProvider } from "@calcom/features/notifications/WebPushContext";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
|
||||
import type { AppProps } from "@lib/app-providers";
|
||||
@@ -13,18 +14,14 @@ import "../styles/globals.css";
|
||||
function MyApp(props: AppProps) {
|
||||
const { Component, pageProps } = props;
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== "undefined" && "serviceWorker" in navigator) {
|
||||
navigator.serviceWorker.register("/service-worker.js");
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<SessionProvider session={pageProps.session ?? undefined}>
|
||||
{/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */}
|
||||
<CacheProvider>
|
||||
{Component.PageWrapper ? <Component.PageWrapper {...props} /> : <Component {...pageProps} />}
|
||||
</CacheProvider>
|
||||
<WebPushProvider>
|
||||
{/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */}
|
||||
<CacheProvider>
|
||||
{Component.PageWrapper ? <Component.PageWrapper {...props} /> : <Component {...pageProps} />}
|
||||
</CacheProvider>
|
||||
</WebPushProvider>
|
||||
</SessionProvider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user