From 57adc427b3602f8b4392b82bc1355f65446906b7 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 26 Oct 2025 12:48:06 -0400 Subject: [PATCH 1/2] Show experimental login warnings on provider selection --- js/app.js | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/js/app.js b/js/app.js index af1c9837..bc086fe3 100644 --- a/js/app.js +++ b/js/app.js @@ -1240,6 +1240,8 @@ class Application { this.statusMessage = this.statusContainer?.querySelector("[data-status-message]") || null; this.statusAutoHideHandle = null; + this.lastExperimentalWarningKey = null; + this.lastExperimentalWarningAt = 0; // Auth state this.pubkey = null; @@ -3733,6 +3735,7 @@ class Application { callbacks: { onProviderSelected: (providerId) => { devLogger.log(`[LoginModal] Provider selected: ${providerId}.`); + this.maybeShowExperimentalLoginWarning(providerId); }, onLoginSuccess: (payload) => { const maybePromise = this.handleLoginModalSuccess(payload); @@ -5608,6 +5611,37 @@ class Application { } } + maybeShowExperimentalLoginWarning(provider) { + const normalizedProvider = + typeof provider === "string" ? provider.trim().toLowerCase() : ""; + + if (normalizedProvider !== "nsec" && normalizedProvider !== "nip46") { + return; + } + + const now = Date.now(); + if ( + this.lastExperimentalWarningKey === normalizedProvider && + typeof this.lastExperimentalWarningAt === "number" && + now - this.lastExperimentalWarningAt < 2000 + ) { + return; + } + + this.lastExperimentalWarningKey = normalizedProvider; + this.lastExperimentalWarningAt = now; + + const providerLabel = + normalizedProvider === "nsec" + ? "Direct nsec or seed" + : "NIP-46 remote signer"; + + this.showStatus( + `${providerLabel} logins are still in development and may not work well yet. We recommend using a NIP-07 browser extension for the most reliable experience.`, + { showSpinner: false, autoHideMs: 15000 }, + ); + } + async handleAuthLogin(detail = {}) { const postLoginPromise = detail && typeof detail.postLoginPromise?.then === "function" @@ -5636,16 +5670,7 @@ class Application { const normalizedProvider = (rawProviderId || rawAuthType).toLowerCase() || ""; - if (normalizedProvider === "nsec" || normalizedProvider === "nip46") { - const providerLabel = - normalizedProvider === "nsec" - ? "Direct nsec or seed" - : "NIP-46 remote signer"; - this.showStatus( - `${providerLabel} logins are still in development and may not work well yet. We recommend using a NIP-07 browser extension for the most reliable experience.`, - { showSpinner: false, autoHideMs: 15000 }, - ); - } + this.maybeShowExperimentalLoginWarning(normalizedProvider); const loginContext = { pubkey: detail?.pubkey || this.pubkey, From 61fe4dba1bda1b254318c091c83082ed6b6144b7 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 26 Oct 2025 12:52:00 -0400 Subject: [PATCH 2/2] Shorten experimental login warning toast duration --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index bc086fe3..61bab537 100644 --- a/js/app.js +++ b/js/app.js @@ -5638,7 +5638,7 @@ class Application { this.showStatus( `${providerLabel} logins are still in development and may not work well yet. We recommend using a NIP-07 browser extension for the most reliable experience.`, - { showSpinner: false, autoHideMs: 15000 }, + { showSpinner: false, autoHideMs: 5000 }, ); }