From 15cdb7b64a33326862cbcfba59696b2e9146ac21 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Thu, 12 Mar 2026 13:35:42 +0900 Subject: [PATCH] chore: Show editor picker once to existing users as well --- src/lib/util/migration/domainMigration.ts | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/lib/util/migration/domainMigration.ts b/src/lib/util/migration/domainMigration.ts index 2668bd29..4300ac1d 100644 --- a/src/lib/util/migration/domainMigration.ts +++ b/src/lib/util/migration/domainMigration.ts @@ -11,27 +11,6 @@ export const isOnMermaidAI = (): boolean => { return domain === mermaidAiDomain || domain.endsWith(`.${mermaidAiDomain}`); }; -// localStorage keys that indicate a returning user. -// Note: codeStore is excluded because it's always populated with the default state on first load. -const userDataStorageKeys = [ - 'manualHistoryStore', // Manual history entries - 'autoHistoryStore' // Auto history entries -]; - -/** - * Check if user has any stored data in localStorage. - * This includes saved diagrams, history entries, etc. - */ -const hasStoredUserData = (): boolean => { - for (const key of userDataStorageKeys) { - const value = window.localStorage.getItem(key); - if (value && value !== '[]' && value !== 'null' && value !== '{}') { - return true; - } - } - return false; -}; - /** * Check if the current URL has pako data (diagram content from a shared link). */ @@ -70,7 +49,6 @@ export const shouldShowEditorChooser = (): boolean => { if (!env.isEnabledMermaidChartLinks) return false; if (window.innerWidth < 640) return false; if (window.localStorage.getItem(C.editorChooserDismissedKey) === 'true') return false; - if (hasStoredUserData()) return false; if (hasPakoData()) return false; if (isReferredFromMermaid()) return false; return true;