init studio admin frontend
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
export const selectedAppStorageKey = 'studio-admin:selected-app-id';
|
||||
const legacySelectedAppStorageKey = 'studio-selected-app-id';
|
||||
|
||||
export function getStoredSelectedAppId() {
|
||||
const current = window.localStorage.getItem(selectedAppStorageKey);
|
||||
if (current) return current;
|
||||
|
||||
const legacy = window.localStorage.getItem(legacySelectedAppStorageKey);
|
||||
if (legacy) {
|
||||
setStoredSelectedAppId(legacy);
|
||||
window.localStorage.removeItem(legacySelectedAppStorageKey);
|
||||
return legacy;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
export function setStoredSelectedAppId(appId: string) {
|
||||
if (!appId) return;
|
||||
window.localStorage.setItem(selectedAppStorageKey, appId);
|
||||
}
|
||||
Reference in New Issue
Block a user