This commit is contained in:
Timothy Jaeryang Baek committed 2026-12-01 01:02:02 +04:00
1 parent fc0f0701c5
commit c78060a62d
15 files changed
+325 -19

No files matched your search

@@ -1,5 +1,6 @@
<script lang="ts">
import { getContext } from 'svelte';
import { getChangedKeys } from '$lib/utils';
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
@@ -18,15 +19,7 @@
let saveButton: HTMLButtonElement;
let showConfirm: boolean = false;
// numbers typed into text fields and cleared fields compare equal to what was loaded
const serialize = (value: any) =>
value !== null && typeof value === 'object' ? JSON.stringify(value) : String(value ?? '');
$: changedKeys = savedConfig
? Object.keys({ ...savedConfig, ...settings }).filter(
(key) => serialize(savedConfig[key]) !== serialize(settings?.[key])
)
: [];
$: changedKeys = getChangedKeys(savedConfig, settings);
const formatValue = (value: any) => {
if (value === null || value === undefined || value === '') {