Skip to content

Commit 10ac9fb

Browse files
committed
remove site changes
1 parent c06558e commit 10ac9fb

File tree

5 files changed

+1
-67
lines changed

5 files changed

+1
-67
lines changed

site/src/api/api.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,28 +2371,6 @@ class ApiMethods {
23712371
await this.axios.post<void>("/api/v2/notifications/test");
23722372
};
23732373

2374-
createNotificationPushSubscription = async (
2375-
userId: string,
2376-
req: TypesGen.WebpushSubscription,
2377-
) => {
2378-
await this.axios.post<void>(
2379-
`/api/v2/users/${userId}/webpush/subscription`,
2380-
req,
2381-
);
2382-
};
2383-
2384-
deleteNotificationPushSubscription = async (
2385-
userId: string,
2386-
req: TypesGen.DeleteWebpushSubscription,
2387-
) => {
2388-
await this.axios.delete<void>(
2389-
`/api/v2/users/${userId}/webpush/subscription`,
2390-
{
2391-
data: req,
2392-
},
2393-
);
2394-
};
2395-
23962374
requestOneTimePassword = async (
23972375
req: TypesGen.RequestOneTimePasscodeRequest,
23982376
) => {

site/src/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,5 @@ if (element === null) {
1414
throw new Error("root element is null");
1515
}
1616

17-
// The service worker handles push notifications.
18-
if ("serviceWorker" in navigator) {
19-
navigator.serviceWorker.register("/serviceWorker.js");
20-
}
21-
2217
const root = createRoot(element);
2318
root.render(<App />);

site/src/modules/dashboard/Navbar/NavbarView.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import { API } from "api/api";
2-
import { experiments } from "api/queries/experiments";
32
import type * as TypesGen from "api/typesGenerated";
4-
import { Button } from "components/Button/Button";
53
import { ExternalImage } from "components/ExternalImage/ExternalImage";
64
import { CoderIcon } from "components/Icons/CoderIcon";
75
import type { ProxyContextValue } from "contexts/ProxyContext";
8-
import { useWebpushNotifications } from "contexts/useWebpushNotifications";
9-
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
106
import { NotificationsInbox } from "modules/notifications/NotificationsInbox/NotificationsInbox";
117
import type { FC } from "react";
12-
import { useQuery } from "react-query";
138
import { NavLink, useLocation } from "react-router-dom";
149
import { cn } from "utils/cn";
1510
import { DeploymentDropdown } from "./DeploymentDropdown";
@@ -48,9 +43,6 @@ export const NavbarView: FC<NavbarViewProps> = ({
4843
canViewAuditLog,
4944
proxyContextValue,
5045
}) => {
51-
const { subscribed, enabled, loading, subscribe, unsubscribe } =
52-
useWebpushNotifications();
53-
5446
return (
5547
<div className="border-0 border-b border-solid h-[72px] flex items-center leading-none px-6">
5648
<NavLink to="/workspaces">
@@ -63,7 +55,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
6355

6456
<NavItems className="ml-4" />
6557

66-
<div className=" hidden md:flex items-center gap-3 ml-auto">
58+
<div className="flex items-center gap-3 ml-auto">
6759
{proxyContextValue && (
6860
<div className="hidden md:block">
6961
<ProxyMenu proxyContextValue={proxyContextValue} />
@@ -79,18 +71,6 @@ export const NavbarView: FC<NavbarViewProps> = ({
7971
/>
8072
</div>
8173

82-
{enabled ? (
83-
subscribed ? (
84-
<Button variant="outline" disabled={loading} onClick={unsubscribe}>
85-
Disable WebPush
86-
</Button>
87-
) : (
88-
<Button variant="outline" disabled={loading} onClick={subscribe}>
89-
Enable WebPush
90-
</Button>
91-
)
92-
) : null}
93-
9474
<NotificationsInbox
9575
fetchNotifications={API.getInboxNotifications}
9676
markAllAsRead={API.markAllInboxNotificationsAsRead}

site/src/testHelpers/entities.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ export const MockBuildInfo: TypesGen.BuildInfoResponse = {
227227
workspace_proxy: false,
228228
upgrade_message: "My custom upgrade message",
229229
deployment_id: "510d407f-e521-4180-b559-eab4a6d802b8",
230-
webpush_public_key: "fake-public-key",
231230
telemetry: true,
232231
};
233232

site/vite.config.mts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as path from "node:path";
22
import react from "@vitejs/plugin-react";
3-
import { buildSync } from "esbuild";
43
import { visualizer } from "rollup-plugin-visualizer";
54
import { type PluginOption, defineConfig } from "vite";
65
import checker from "vite-plugin-checker";
@@ -29,19 +28,6 @@ export default defineConfig({
2928
emptyOutDir: false,
3029
// 'hidden' works like true except that the corresponding sourcemap comments in the bundled files are suppressed
3130
sourcemap: "hidden",
32-
rollupOptions: {
33-
input: {
34-
index: path.resolve(__dirname, "./index.html"),
35-
serviceWorker: path.resolve(__dirname, "./src/serviceWorker.ts"),
36-
},
37-
output: {
38-
entryFileNames: (chunkInfo) => {
39-
return chunkInfo.name === "serviceWorker"
40-
? "[name].js"
41-
: "assets/[name]-[hash].js";
42-
},
43-
},
44-
},
4531
},
4632
define: {
4733
"process.env": {
@@ -103,10 +89,6 @@ export default defineConfig({
10389
target: process.env.CODER_HOST || "http://localhost:3000",
10490
secure: process.env.NODE_ENV === "production",
10591
},
106-
"/serviceWorker.js": {
107-
target: process.env.CODER_HOST || "http://localhost:3000",
108-
secure: process.env.NODE_ENV === "production",
109-
},
11092
},
11193
allowedHosts: true,
11294
},

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy