File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments