File tree Expand file tree Collapse file tree 2 files changed +0
-30
lines changed
Expand file tree Collapse file tree 2 files changed +0
-30
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,8 @@ import { PWAModeProvider } from "./PWAContext";
1414import KeyboardShortcutsHelp from "@/components/KeyboardShortcutsHelp" ;
1515import { ErrorBoundary } from "react-error-boundary" ;
1616import ErrorBoundaryFallback from "./components/ErrorBoundaryFallback" ;
17- import useWebPushNotifications from "./hooks/useWebPushNotifications" ;
1817
1918export default function App ( ) {
20- useWebPushNotifications ( ) ; // TODO, move this to a more appropriate place
21-
2219 const location = useLocation ( ) ;
2320 return (
2421 < ErrorBoundary
Original file line number Diff line number Diff line change @@ -22,33 +22,6 @@ function webPushEndpoints(app) {
2222 const publicKey = pushNotificationService . publicVapidKey ;
2323 response . status ( 200 ) . json ( { publicKey } ) ;
2424 } ) ;
25-
26- // TODO: Remove this endpoint after testing
27- app . get ( "/web-push/test" , [ validatedRequest ] , async ( _request , response ) => {
28- if ( response . locals . multiUserMode ) {
29- console . log ( "Sending notification to user" ) ;
30- const { user } = response . locals ;
31- console . log ( JSON . stringify ( user , null , 2 ) ) ;
32- pushNotificationService . sendNotification ( {
33- to : user . id ,
34- payload : {
35- title : `Hello, ${ user . username } ` ,
36- body : `This is a test notification for ${ user . username } from AnythingLLM` ,
37- } ,
38- } ) ;
39- return response . status ( 200 ) . json ( { } ) ;
40- }
41-
42- console . log ( "Sending notification to primary user" ) ;
43- pushNotificationService . sendNotification ( {
44- to : "primary" ,
45- payload : {
46- title : "Test Notification" ,
47- body : "This is a test notification" ,
48- } ,
49- } ) ;
50- response . status ( 200 ) . json ( { } ) ;
51- } ) ;
5225}
5326
5427module . exports = { webPushEndpoints } ;
You can’t perform that action at this time.
0 commit comments