From 7192ba381dba80b6dda8508d2cadb68fcb6f0939 Mon Sep 17 00:00:00 2001 From: ramvignesh-b Date: Tue, 12 May 2026 03:41:08 +0530 Subject: [PATCH] fix: clear invalid API key and reset state on unlock failure --- src/views/dashboard.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/views/dashboard.js b/src/views/dashboard.js index b62d12b..17bd765 100644 --- a/src/views/dashboard.js +++ b/src/views/dashboard.js @@ -43,7 +43,10 @@ document.addEventListener("alpine:init", () => { await this.fetchProviders(); this.isUnlocked = true; } catch (err) { - this.showNotification(`Failed to unlock: ${err.message}`, "error"); + this.showNotification(`Failed to unlock: ${err.message}. Check your API Key`, "error"); + localStorage.removeItem("toknd_api_key"); + this.isUnlocked = false; + this.apiKey = ""; } finally { this.loading = false; }