feat: restructure settings into identity, server, backup and advanced tabs

Drops the per-server pin list down to the one server your account is
bound to, adds an enforced network timeout, and replaces the global
status toast inside settings with inline feedback and a reusable
confirm dialog for rotate/log out. Mail-fetching preferences move into
the server tab; the now-superseded claim/recall forms are gone since
onboarding covers both.
This commit is contained in:
randogoth 2026-10-08 21:24:05 +03:00
parent fb0ca5c8cc
commit 84397a3fdd
6 changed files with 270 additions and 334 deletions

View file

@ -141,12 +141,6 @@ export function pinServer(host, keyBytes) {
});
}
export function unpinServer(host) {
update(state => {
delete (state.servers || {})[host];
});
}
export function allPins() {
return Object.entries(load().servers || {}).map(([host, key]) => ({ host, key }));
}
@ -164,14 +158,17 @@ export function setLeaveOnServer(value) {
update(state => { state.leaveOnServer = value; });
}
// The user's own word that the master is written down somewhere else. Nothing
// can verify it, so it is a settings-panel reminder, never a guard.
export function masterSaved() {
return load().masterSaved ?? false;
// Seconds a network call waits for a response before giving up. Applied per
// read, not per operation, so a slow-but-trickling exchange is not cut off
// just because it spans several reads.
export function timeoutSeconds() {
return load().timeoutSeconds ?? 30;
}
export function setMasterSaved(value) {
update(state => { state.masterSaved = value; });
export function setTimeoutSeconds(value) {
const n = Math.trunc(Number(value));
if (!Number.isFinite(n)) return; // non-numeric input is ignored, not an error
update(state => { state.timeoutSeconds = Math.min(600, Math.max(1, n)); });
}
// Undoes setIdentity()/restoreMaster(): onboarding's "back"/"start over",
@ -185,7 +182,6 @@ export function discardIdentity() {
delete state.syncOk;
delete state.afterTime;
delete state.afterId;
delete state.masterSaved;
});
}