Virtual whiteboard for sketching hand-drawn like diagrams
feat: Add rewrite to webex landing page (#4102)
Aakansha Doshi516e7656f303
diff --git a/src/serviceWorker.tsx b/src/serviceWorker.tsxindex 1ef7271a0a..1784c8aa92 100644--- a/src/serviceWorker.tsx+++ b/src/serviceWorker.tsx@@ -37,6 +37,13 @@ export const register = (config?: Config) => {}window.addEventListener("load", () => {+ const isWebexLP = window.location.pathname.startsWith("/webex");+ if (isWebexLP) {+ unregister(() => {+ window.location.reload();+ });+ return false;+ }const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;if (isLocalhost) {@@ -135,11 +142,14 @@ const checkValidServiceWorker = (swUrl: string, config?: Config) => {});};-export const unregister = () => {+export const unregister = (callback?: () => void) => {if ("serviceWorker" in navigator) {navigator.serviceWorker.ready.then((registration) => {- registration.unregister();+ return registration.unregister();+ })+ .then(() => {+ callback?.();}).catch((error) => {console.error(error.message);diff --git a/vercel.json b/vercel.jsonindex e95073736a..75a3de258d 100644--- a/vercel.json+++ b/vercel.json@@ -22,5 +22,11 @@}]}+ ],+ "rewrites": [+ {+ "source": "/webex/:match*",+ "destination": "https://excalidraw-webex-lp.vercel.app/:match*"+ }]}