Fix update preferences not being tracked

This commit is contained in:
2025-05-25 18:34:30 +03:00
parent 76338eff71
commit 390f7e0078

View File

@@ -38,7 +38,11 @@ onMounted(() => {
const saveOp = watchPausable(
preferences,
async () => {
async (newData) => {
trackEvent("update_preferences", {
...newData,
});
await $fetch("/api/preferences", {
method: "PUT",
body: toValue(preferences),
@@ -47,13 +51,6 @@ const saveOp = watchPausable(
{
initialState: "paused",
deep: true,
onTrigger: (event) => {
trackEvent("update_preferences", {
key: event.key,
value: event.newValue,
oldValue: event.oldValue,
});
},
},
);
</script>