From 0836872f51cb3d94a83c8febf4d344ce866dea31 Mon Sep 17 00:00:00 2001 From: hzrd149 Date: Sun, 11 Jun 2023 10:30:23 -0500 Subject: [PATCH] only register handler for prod builds --- src/index.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 02401761d..802868829 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -4,11 +4,13 @@ import { App } from "./app"; import { Providers } from "./providers"; // register nostr: protocol handler -try { - navigator.registerProtocolHandler("web+nostr", new URL("/l/%s", location.origin).toString()); -} catch (e) { - console.log("Failed to register handler"); - console.log(e); +if (import.meta.env.PROD) { + try { + navigator.registerProtocolHandler("web+nostr", new URL("/l/%s", location.origin).toString()); + } catch (e) { + console.log("Failed to register handler"); + console.log(e); + } } const element = document.getElementById("root");