Skip to content

Commit 30cb40a

Browse files
committed
fix(preferences): show template reset button when inherited template is resolved
The showTemplateResetButton:false override was added as a workaround when inheritedTemplate was always empty in the user Preferences context (because resolveEditorProps was discarding the loadState fallback). Now that resolveEditorProps correctly falls back to the PHP-injected system-level footer template when no admin-level template is configured, inheritedTemplate is always properly resolved. Remove the guard so the editor's own showResetTemplateButton computed takes over: - hidden when currentTemplate == inheritedTemplate (nothing to reset) - shown when the user's template differs from the inherited default This allows users to reset just their footer template back to the inherited default (instance admin > group admin > system default) without having to clear their entire preference. Signed-off-by: Vitor Mattos <[email protected]>
1 parent c9729ca commit 30cb40a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/views/Preferences/Preferences.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ function editorPropsFor(policyKey: string): Record<string, unknown> {
160160
161161
return {
162162
...resolvedEditorProps,
163-
...(policyKey === 'add_footer' ? { showTemplateResetButton: false } : {}),
164163
editorScope: 'user',
165164
editorMode: 'edit',
166165
}
@@ -217,6 +216,7 @@ async function savePreferenceByKey(policyKey: string, value: EffectivePolicyValu
217216
218217
async function clearPreferenceByKey(policyKey: string): Promise<void> {
219218
await clearPreferenceValue(policyKey, t('libresign', 'Could not clear your preference. Try again.'))
219+
await policiesStore.fetchEffectivePolicies()
220220
syncSelectedPreference(policyKey)
221221
}
222222

0 commit comments

Comments
 (0)