mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 10:40:23 +00:00
build: update deps except carbon
This commit is contained in:
@@ -25,13 +25,10 @@ function createStorageMock(): Storage {
|
||||
}
|
||||
|
||||
function setTestLocation(params: { protocol: string; host: string; pathname: string }) {
|
||||
if (typeof window !== "undefined" && window.history?.replaceState) {
|
||||
window.history.replaceState({}, "", params.pathname);
|
||||
return;
|
||||
}
|
||||
vi.stubGlobal("location", {
|
||||
protocol: params.protocol,
|
||||
host: params.host,
|
||||
hostname: params.host.replace(/:\d+$/, ""),
|
||||
pathname: params.pathname,
|
||||
} as Location);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const SETTINGS_KEY_PREFIX = "openclaw.control.settings.v1:";
|
||||
const LEGACY_SETTINGS_KEY = "openclaw.control.settings.v1";
|
||||
const LEGACY_TOKEN_SESSION_KEY = "openclaw.control.token.v1";
|
||||
const TOKEN_SESSION_KEY_PREFIX = "openclaw.control.token.v1:";
|
||||
const MAX_SCOPED_SESSION_ENTRIES = 10;
|
||||
@@ -197,7 +198,7 @@ export function loadSettings(): UiSettings {
|
||||
const raw =
|
||||
storage?.getItem(scopedKey) ??
|
||||
storage?.getItem(SETTINGS_KEY_PREFIX + "default") ??
|
||||
storage?.getItem("openclaw.control.settings.v1");
|
||||
storage?.getItem(LEGACY_SETTINGS_KEY);
|
||||
if (!raw) {
|
||||
return defaults;
|
||||
}
|
||||
@@ -308,5 +309,9 @@ function persistSettings(next: UiSettings) {
|
||||
sessionsByGateway,
|
||||
...(next.locale ? { locale: next.locale } : {}),
|
||||
};
|
||||
storage?.setItem(scopedKey, JSON.stringify(persisted));
|
||||
const serialized = JSON.stringify(persisted);
|
||||
storage?.setItem(scopedKey, serialized);
|
||||
// Keep the legacy unscoped key in sync for older readers and migration tests,
|
||||
// but never include the session token in persistent storage.
|
||||
storage?.setItem(LEGACY_SETTINGS_KEY, serialized);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user