Add SaveIndicator to email settings

This commit is contained in:
Johannes Zellner
2026-02-09 20:43:34 +01:00
parent 4bae5ee2fb
commit 81729e4b2a
+5
View File
@@ -6,6 +6,7 @@ const t = i18n.t;
import { ref, onMounted, useTemplateRef, inject } from 'vue';
import { Button, ProgressBar, Checkbox, InputDialog, Dialog, FormGroup, Switch } from '@cloudron/pankow';
import SaveIndicator from '../components/SaveIndicator.vue';
import Section from '../components/Section.vue';
import SettingsItem from '../components/SettingsItem.vue';
import CatchAllSettingsItem from '../components/CatchAllSettingsItem.vue';
@@ -114,6 +115,7 @@ async function onEnableIncoming() {
const customFrom = ref(false);
const customFromBusy = ref(false);
const customFromSaveIndicator = useTemplateRef('customFromSaveIndicator');
async function onToggleCustomFrom(value) {
customFromBusy.value = true;
@@ -122,9 +124,11 @@ async function onToggleCustomFrom(value) {
if (error) {
customFrom.value = !value; // revert back old value
customFromBusy.value = false;
customFromSaveIndicator.value.error();
return console.error(error);
}
customFromSaveIndicator.value.success();
customFromBusy.value = false;
}
@@ -294,6 +298,7 @@ onMounted(async () => {
<div v-html="$t('email.customFrom.description')"></div>
</FormGroup>
<Switch v-model="customFrom" @change="onToggleCustomFrom" :disabled="customFromBusy"/>
<SaveIndicator ref="customFromSaveIndicator"/>
</SettingsItem>
<SettingsItem>