fix(settings): restore archive password list

Load the stored archive password list through a dedicated trusted IPC channel when extraction settings are opened. Preserve write-only drafts across settings and account updates, guard unsaved edits against late responses, and invalidate stale loads during backup imports. Prepare version 2.0.46 with public release notes.
This commit is contained in:
Sucukdeluxe
2026-08-20 00:45:46 +02:00
parent 09ea7803f3
commit 08f017e8c4
16 changed files with 164 additions and 14 deletions
+9
View File
@@ -15,6 +15,10 @@ export function createVisualElectronApi(
const searchParams = new URLSearchParams(search);
const historyState = searchParams.get("history-state");
if (searchParams.get("animations") === "off") fixture.snapshot.settings.animatePackageDisclosure = false;
let archivePasswordList = searchParams.get("archive-passwords") === "configured"
? "visual-archive-password-one\nvisual-archive-password-two"
: fixture.snapshot.settings.archivePasswordListConfigured ? "visual-archive-password" : "";
fixture.snapshot.settings.archivePasswordListConfigured = archivePasswordList.length > 0;
let historyRequestCount = 0;
const stateUpdateListeners = new Set<Parameters<ElectronApi["onStateUpdate"]>[0]>();
const emitStateUpdate = (): void => {
@@ -23,6 +27,10 @@ export function createVisualElectronApi(
};
const updateSettings = (settings: RendererSettingsUpdate): RendererSettings => {
const { archivePasswordList: _archivePasswordList, notifyUrl: _notifyUrl, ...safe } = settings;
if (typeof _archivePasswordList === "string") {
archivePasswordList = _archivePasswordList;
fixture.snapshot.settings.archivePasswordListConfigured = archivePasswordList.trim().length > 0;
}
Object.assign(fixture.snapshot.settings, safe);
emitStateUpdate();
return clone(fixture.snapshot.settings);
@@ -30,6 +38,7 @@ export function createVisualElectronApi(
return {
getSnapshot: async () => clone(fixture.snapshot),
getArchivePasswordList: async () => ({ passwords: archivePasswordList }),
getVersion: async () => "2.0.12",
checkUpdates: async () => clone(fixture.update),
installUpdate: async () => ({ started: true, message: "Visual update gestartet" }),