Skip to content

Commit ede98bc

Browse files
cleanup for web-push bootstrapping
1 parent e839497 commit ede98bc

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

frontend/src/App.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ import { PWAModeProvider } from "./PWAContext";
1414
import KeyboardShortcutsHelp from "@/components/KeyboardShortcutsHelp";
1515
import { ErrorBoundary } from "react-error-boundary";
1616
import ErrorBoundaryFallback from "./components/ErrorBoundaryFallback";
17-
import useWebPushNotifications from "./hooks/useWebPushNotifications";
1817

1918
export default function App() {
20-
useWebPushNotifications(); // TODO, move this to a more appropriate place
21-
2219
const location = useLocation();
2320
return (
2421
<ErrorBoundary

server/endpoints/webPush.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff 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

5427
module.exports = { webPushEndpoints };

0 commit comments

Comments
 (0)