provider rating editable + fix config settings

This commit is contained in:
Peter BALIVET 2025-06-30 14:48:24 +02:00
parent dba575761e
commit ab00b306e2
3 changed files with 16 additions and 19 deletions

View file

@ -57,7 +57,7 @@
</div>
<div role="article" :aria-label="$strings.LabelSettingsEnableCommunityRatingHelp" class="flex items-center py-2">
<ui-toggle-switch :label="$strings.LabelSettingsEnableCommunityRating" v-model="newServerSettings.enableCommunityRating" :disabled="updatingServerSettings" @input="(val) => updateSettingsKey('enableCommunityRating', val)" />
<ui-toggle-switch :label="$strings.LabelSettingsEnableCommunityRating" v-model="newServerSettings.enableCommunityRating" :disabled="updatingServerSettings || communityRatingDisabled" @input="(val) => updateSettingsKey('enableCommunityRating', val)" />
<ui-tooltip aria-hidden="true" :text="$strings.LabelSettingsEnableCommunityRatingHelp">
<p class="pl-4">
<span id="settings-enable-community-rating">{{ $strings.LabelSettingsEnableCommunityRating }}</span>
@ -279,6 +279,12 @@ export default {
}
},
watch: {
communityRatingDisabled(isDisabled) {
if (isDisabled && this.newServerSettings.enableCommunityRating) {
this.newServerSettings.enableCommunityRating = false
this.updateSettingsKey('enableCommunityRating', false)
}
},
serverSettings(newVal, oldVal) {
if (newVal && !oldVal) {
this.initServerSettings()
@ -286,6 +292,9 @@ export default {
}
},
computed: {
communityRatingDisabled() {
return !this.newServerSettings.enableRating && !this.newServerSettings.enableExplicitRating
},
serverSettings() {
return this.$store.state.serverSettings
},