refactor: ♻️ Rewrite settings backend

This commit is contained in:
Jesse Wierzbinski 2024-07-21 18:53:16 +02:00
parent 80b1fc87f7
commit 78e4fa0f04
No known key found for this signature in database
6 changed files with 133 additions and 126 deletions

View file

@ -36,14 +36,14 @@
<script lang="ts" setup>
import { Switch } from "@ark-ui/vue";
import { type Setting, type SettingIds, SettingType } from "~/settings";
import { type SettingIds, SettingType } from "~/settings";
const props = defineProps<{
setting: Setting;
id: SettingIds;
}>();
const checked = ref(!!props.setting.value);
const setting = useSetting(props.setting.id as SettingIds);
const setting = useSetting(props.id);
const checked = ref(setting.value.value as boolean);
watch(checked, (c) => {
setting.value.value = c;