Release v0.1.8

This commit is contained in:
2026-07-11 17:00:37 +02:00
parent a00ef54821
commit 9a0c467d55
102 changed files with 2150 additions and 9272 deletions

View File

@@ -79,7 +79,7 @@ export function apiUrl(settings: ApiSettings, path: string): string {
export function loadApiSettings(): ApiSettings {
const storedBaseUrl = loadStoredSetting("baseUrl");
const storedApiKey = loadStoredSetting("apiKey");
const storedApiKey = sessionStorage.getItem(`${SESSION_STORAGE_KEY}.apiKey`);
const configuredBaseUrl = storedBaseUrl !== null ? storedBaseUrl : import.meta.env.VITE_API_BASE_URL ?? "";
const apiBaseUrl = normalizeApiBaseUrl(configuredBaseUrl);
@@ -87,11 +87,9 @@ export function loadApiSettings(): ApiSettings {
if (storedBaseUrl !== null && storedBaseUrl !== apiBaseUrl) {
localStorage.setItem(`${STORAGE_KEY}.baseUrl`, apiBaseUrl);
}
if (storedApiKey !== null) {
localStorage.setItem(`${STORAGE_KEY}.apiKey`, storedApiKey);
}
clearLegacyStoredSetting("baseUrl");
clearLegacyStoredSetting("apiKey");
localStorage.removeItem(`${STORAGE_KEY}.apiKey`);
localStorage.removeItem(`${STORAGE_KEY}.accessToken`);
sessionStorage.removeItem(`${SESSION_STORAGE_KEY}.accessToken`);
@@ -106,9 +104,14 @@ export function loadApiSettings(): ApiSettings {
export function saveApiSettings(settings: ApiSettings): void {
localStorage.setItem(`${STORAGE_KEY}.baseUrl`, normalizeApiBaseUrl(settings.apiBaseUrl));
localStorage.setItem(`${STORAGE_KEY}.apiKey`, settings.apiKey);
if (settings.apiKey) {
sessionStorage.setItem(`${SESSION_STORAGE_KEY}.apiKey`, settings.apiKey);
} else {
sessionStorage.removeItem(`${SESSION_STORAGE_KEY}.apiKey`);
}
clearLegacyStoredSetting("baseUrl");
clearLegacyStoredSetting("apiKey");
localStorage.removeItem(`${STORAGE_KEY}.apiKey`);
localStorage.removeItem(`${STORAGE_KEY}.accessToken`);
sessionStorage.removeItem(`${SESSION_STORAGE_KEY}.accessToken`);
}