Skip to content

Commit fc8df6a

Browse files
fixup! feat: automated appointment creation
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
1 parent 1f8ba43 commit fc8df6a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/components/CalendarSettings.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<NcCheckboxRadioSwitch
99
id="imip-create"
1010
:checked="imipCreate"
11+
:disabled="saving"
1112
@update:checked="onToggleImipCreate">
1213
{{ t('mail', 'Automatically create tentative appointments in calendar') }}
1314
</NcCheckboxRadioSwitch>
@@ -25,6 +26,7 @@ export default {
2526
components: {
2627
NcCheckboxRadioSwitch,
2728
},
29+
2830
props: {
2931
account: {
3032
type: Object,
@@ -35,6 +37,7 @@ export default {
3537
data() {
3638
return {
3739
imipCreate: this.account.imipCreate,
40+
saving: false,
3841
}
3942
},
4043
@@ -44,8 +47,13 @@ export default {
4447
4548
methods: {
4649
async onToggleImipCreate(val) {
50+
if (this.saving) {
51+
return
52+
}
53+
4754
const oldVal = this.imipCreate
4855
this.imipCreate = val
56+
this.saving = true
4957
5058
try {
5159
await this.mainStore.patchAccount({
@@ -59,11 +67,10 @@ export default {
5967
Logger.error(`could not ${val ? 'enable' : 'disable'} automatic calendar appointment creation`, { error })
6068
this.imipCreate = oldVal
6169
throw error
70+
} finally {
71+
this.saving = false
6272
}
6373
},
6474
},
6575
}
6676
</script>
67-
68-
<style lang="scss" scoped>
69-
</style>

0 commit comments

Comments
 (0)