@axium/client 0.9.12 → 0.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Preference.svelte +1 -7
- package/package.json +1 -1
package/lib/Preference.svelte
CHANGED
|
@@ -51,13 +51,7 @@
|
|
|
51
51
|
function onchange(e: Event) {
|
|
52
52
|
const value = schema.parse(input instanceof HTMLInputElement && input.type === 'checkbox' ? input.checked : input.value);
|
|
53
53
|
if (value == getByString(preferences, path)) return;
|
|
54
|
-
|
|
55
|
-
if (getByString(preferenceDefaults, path) == value) {
|
|
56
|
-
const parts = path.split('.');
|
|
57
|
-
const prop = parts.pop()!;
|
|
58
|
-
delete getByString<Record<string, any>>(preferences, parts.join('.'))[prop];
|
|
59
|
-
} else setByString(preferences, path, value);
|
|
60
|
-
|
|
54
|
+
setByString(preferences, path, value);
|
|
61
55
|
fetchAPI('PATCH', 'users/:id', { preferences }, userId);
|
|
62
56
|
}
|
|
63
57
|
</script>
|