chore: exclude local resource artifacts from main sync
This commit is contained in:
7
src/app/main/appConfig.ts
Executable file → Normal file
7
src/app/main/appConfig.ts
Executable file → Normal file
@@ -1,6 +1,7 @@
|
||||
import { useSyncExternalStore } from 'react';
|
||||
import { appendClientIdHeader } from './clientIdentity';
|
||||
import { getAutomationNotificationPreferenceTarget } from './notificationIdentity';
|
||||
import { isPreviewRuntime } from './previewRuntime';
|
||||
|
||||
export const APP_CONFIG_STORAGE_KEY = 'work-server.app-config';
|
||||
const APP_CONFIG_EVENT = 'work-server:app-config';
|
||||
@@ -651,7 +652,8 @@ export function getStoredAppConfig(): AppConfig {
|
||||
}
|
||||
|
||||
try {
|
||||
const raw = window.localStorage.getItem(APP_CONFIG_STORAGE_KEY);
|
||||
const storage = isPreviewRuntime() ? window.sessionStorage : window.localStorage;
|
||||
const raw = storage.getItem(APP_CONFIG_STORAGE_KEY);
|
||||
|
||||
if (!raw) {
|
||||
cachedConfig = DEFAULT_APP_CONFIG;
|
||||
@@ -683,7 +685,8 @@ export function setStoredAppConfig(config: AppConfig) {
|
||||
const raw = JSON.stringify(normalized);
|
||||
cachedConfig = normalized;
|
||||
cachedRawConfig = raw;
|
||||
window.localStorage.setItem(APP_CONFIG_STORAGE_KEY, raw);
|
||||
const storage = isPreviewRuntime() ? window.sessionStorage : window.localStorage;
|
||||
storage.setItem(APP_CONFIG_STORAGE_KEY, raw);
|
||||
emitConfigChange();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user