From 3cbf8fc8b347d7d18bf8a529ec3a13754922936e Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 30 Apr 2026 11:53:34 +0200 Subject: [PATCH] fix(settings): properly handle loading state Signed-off-by: Ferdinand Thiessen --- src/FormsSettings.vue | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/FormsSettings.vue b/src/FormsSettings.vue index 60c607c8e..f3c6afc8f 100644 --- a/src/FormsSettings.vue +++ b/src/FormsSettings.vue @@ -7,9 +7,9 @@
{{ t('forms', 'Restrict form creation to selected groups') }} @@ -26,22 +26,22 @@ {{ t('forms', 'Allow sharing by link') }} {{ t('forms', 'Allow sharing to all logged in accounts') }} {{ @@ -78,6 +78,7 @@ export default { return { appConfig: loadState(appName, 'appConfig'), availableGroups: loadState(appName, 'availableGroups'), + loading: {}, } }, @@ -92,41 +93,36 @@ export default { * @param {boolean|Array} newVal The resp. new Value to store. */ async onRestrictCreationChange(newVal) { - const el = this.$refs.switchRestrictCreation - el.loading = true + this.loading.restrictCreation = true await this.saveAppConfig('restrictCreation', newVal) - el.loading = false + this.loading.restrictCreation = false }, async onCreationAllowedGroupsChange(newVal) { - const el = this.$refs.switchRestrictCreation - el.loading = true + this.loading.creationAllowedGroups = true await this.saveAppConfig( 'creationAllowedGroups', newVal.map((group) => group.groupId), ) - el.loading = false + this.loading.creationAllowedGroups = false }, async onAllowPublicLinkChange(newVal) { - const el = this.$refs.switchAllowPublicLink - el.loading = true + this.loading.allowPublicLink = true await this.saveAppConfig('allowPublicLink', newVal) - el.loading = false + this.loading.allowPublicLink = false }, async onAllowPermitAllChange(newVal) { - const el = this.$refs.switchAllowPermitAll - el.loading = true + this.loading.allowPermitAll = true await this.saveAppConfig('allowPermitAll', newVal) - el.loading = false + this.loading.allowPermitAll = false }, async onAllowShowToAllChange(newVal) { - const el = this.$refs.switchAllowShowToAll - el.loading = true + this.loading.allowShowToAll = true await this.saveAppConfig('allowShowToAll', newVal) - el.loading = false + this.loading.allowShowToAll = false }, /**