move zoom to settings dialog, add button to repair app

This commit is contained in:
marlon-erler
2024-07-12 21:11:33 +02:00
parent d24fe63146
commit 814452836d
6 changed files with 133 additions and 26 deletions
+15
View File
@@ -145,6 +145,7 @@ export const outboxTextStyle = React.createProxyState([outboxItemCount], () =>
);
// MISC
export const isPresentingSettingsModal = new React.State(false);
export const isEncryptionAvailable = window.crypto.subtle != undefined;
export const senderName = React.restoreState("sender-name", "");
export const pageZoom = React.restoreState("page-zoom", 100);
@@ -152,6 +153,20 @@ pageZoom.subscribe(() => {
document.body.style.zoom = `${pageZoom.value}%`;
});
export function toggleSettings() {
isPresentingSettingsModal.value = !isPresentingSettingsModal.value;
}
export function repairApp() {
removeSetDuplicates(previousAddresses);
removeSetDuplicates(usedObjectCategories);
removeSetDuplicates(usedObjectStatuses);
}
function removeSetDuplicates(listState: React.ListState<any>) {
listState.value = new Set([...listState.value]);
}
const zoomStep = 10;
export function zoomOut() {
pageZoom.value -= zoomStep;