File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ import { LocalStorage } from "@raycast/api";
33const OLD_KEY = "app_key" ;
44const NEW_KEY = "api_key" ;
55
6- // Cache the migration promise to ensure it only runs once per session
7- let migrationPromise : Promise < boolean > | null = null ;
6+ let migrateAuthKeyPromise : Promise < boolean > | null = null ;
87
98/**
109 * Migrates authentication key from old localStorage key (app_key) to new key (api_key).
@@ -13,12 +12,12 @@ let migrationPromise: Promise<boolean> | null = null;
1312 * @returns {Promise<boolean> } True if migration was performed, false if not needed
1413 */
1514export async function migrateAuthKey ( ) : Promise < boolean > {
16- if ( migrationPromise !== null ) {
17- return migrationPromise ;
15+ if ( migrateAuthKeyPromise !== null ) {
16+ return migrateAuthKeyPromise ;
1817 }
1918
20- migrationPromise = performMigration ( ) ;
21- return migrationPromise ;
19+ migrateAuthKeyPromise = performMigration ( ) ;
20+ return migrateAuthKeyPromise ;
2221}
2322
2423async function performMigration ( ) : Promise < boolean > {
You can’t perform that action at this time.
0 commit comments