mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-09-19 19:20:13 +00:00
Merge branch 'main' of https://github.com/shuaiplus/nodewarden
This commit is contained in:
@@ -14,10 +14,12 @@ export interface PersistedRemoteBrowserState {
|
||||
pathByDestination: Record<string, string>;
|
||||
pageByKey: Record<string, number>;
|
||||
selectedDestinationId: string | null;
|
||||
refreshedAt: Record<string, number>;
|
||||
}
|
||||
|
||||
export const REMOTE_BROWSER_STORAGE_KEY = 'nodewarden.backup.remote-browser.v1';
|
||||
export const REMOTE_BROWSER_ITEMS_PER_PAGE = 10;
|
||||
export const REMOTE_BROWSER_REFRESH_TTL_MS = 5 * 60 * 1000; // 5 minutes
|
||||
|
||||
export const COMMON_TIME_ZONES = [
|
||||
'UTC',
|
||||
@@ -148,6 +150,7 @@ export function loadPersistedRemoteBrowserState(userId?: string | null): Persist
|
||||
pathByDestination: {},
|
||||
pageByKey: {},
|
||||
selectedDestinationId: null,
|
||||
refreshedAt: {},
|
||||
};
|
||||
}
|
||||
const parsed = JSON.parse(raw) as Partial<PersistedRemoteBrowserState>;
|
||||
@@ -156,6 +159,7 @@ export function loadPersistedRemoteBrowserState(userId?: string | null): Persist
|
||||
pathByDestination: parsed.pathByDestination && typeof parsed.pathByDestination === 'object' ? parsed.pathByDestination : {},
|
||||
pageByKey: parsed.pageByKey && typeof parsed.pageByKey === 'object' ? parsed.pageByKey : {},
|
||||
selectedDestinationId: typeof parsed.selectedDestinationId === 'string' ? parsed.selectedDestinationId : null,
|
||||
refreshedAt: parsed.refreshedAt && typeof parsed.refreshedAt === 'object' ? parsed.refreshedAt as Record<string, number> : {},
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
@@ -163,6 +167,7 @@ export function loadPersistedRemoteBrowserState(userId?: string | null): Persist
|
||||
pathByDestination: {},
|
||||
pageByKey: {},
|
||||
selectedDestinationId: null,
|
||||
refreshedAt: {},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user