refactor: 🚸 only ask for reload on apply button

This commit is contained in:
ThatOneCalculator 2023-07-25 18:26:55 -07:00
parent 1eab2e944a
commit 03910d7173
No known key found for this signature in database
GPG key ID: 8703CACD01000000

View file

@ -1,12 +1,7 @@
<template> <template>
<div class="_formRoot"> <div class="_formRoot">
<FormSlot> <FormSlot>
<VueDraggable <VueDraggable v-model="items" animation="150" delay="50">
v-model="items"
animation="150"
delay="50"
@end="reloadAsk"
>
<div <div
v-for="(element, index) in items" v-for="(element, index) in items"
:key="index" :key="index"
@ -31,10 +26,18 @@
</button> </button>
</div> </div>
</VueDraggable> </VueDraggable>
<FormButton primary class="_formBlock" @click="addItem"> <FormSection>
<i class="ph-plus ph-bold ph-lg"></i> <div style="display: flex; gap: var(--margin); flex-wrap: wrap">
{{ i18n.ts.addItem }} <FormButton primary @click="addItem">
</FormButton> <i class="ph-plus ph-bold ph-lg"></i>
{{ i18n.ts.addItem }}
</FormButton>
<FormButton @click="reloadAsk">
<i class="ph-floppy-disk-back ph-bold ph-lg"></i>
{{ i18n.ts.apply }}
</FormButton>
</div>
</FormSection>
</FormSlot> </FormSlot>
<FormRadios v-model="menuDisplay" class="_formBlock"> <FormRadios v-model="menuDisplay" class="_formBlock">
@ -62,6 +65,7 @@ import { computed, ref, watch } from "vue";
import FormSlot from "@/components/form/slot.vue"; import FormSlot from "@/components/form/slot.vue";
import FormRadios from "@/components/form/radios.vue"; import FormRadios from "@/components/form/radios.vue";
import FormButton from "@/components/MkButton.vue"; import FormButton from "@/components/MkButton.vue";
import FormSection from "@/components/form/section.vue";
import * as os from "@/os"; import * as os from "@/os";
import { navbarItemDef } from "@/navbar"; import { navbarItemDef } from "@/navbar";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
@ -111,7 +115,6 @@ async function removeItem(index) {
async function save() { async function save() {
defaultStore.set("menu", items.value); defaultStore.set("menu", items.value);
await reloadAsk();
} }
function reset() { function reset() {