From 88376b82ee63e6e5cdcc4222b2182d1981911b78 Mon Sep 17 00:00:00 2001 From: John Livingston Date: Mon, 12 May 2025 15:40:27 +0200 Subject: [PATCH] Adding a warning in settings if theme is not set to Peertube or if autocolors are disabled. --- CHANGELOG.md | 1 + client/admin-plugin-client-plugin.ts | 3 +++ languages/en.yml | 6 ++++++ server/lib/settings.ts | 7 ++++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04a1c6ac..12235472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Fix shebangs (for NixOS compatibility). * Translations updates. * Updating various dependencies. +* Adding a warning in settings if theme is not set to Peertube or if autocolors are disabled. ## 12.0.3 diff --git a/client/admin-plugin-client-plugin.ts b/client/admin-plugin-client-plugin.ts index 17c02c9c..4cae57d1 100644 --- a/client/admin-plugin-client-plugin.ts +++ b/client/admin-plugin-client-plugin.ts @@ -269,6 +269,9 @@ function register (clientOptions: RegisterClientOptions): void { return options.formValues['prosody-components'] !== true case 'converse-autocolors': return options.formValues['converse-theme'] !== 'peertube' + case 'converse-theme-warning': + return options.formValues['converse-theme'] === 'peertube' && + options.formValues['converse-autocolors'] === true case 'chat-per-live-video-warning': return !(options.formValues['chat-all-lives'] === true && options.formValues['chat-per-live-video'] === true) case 'auto-ban-anonymous-ip': diff --git a/languages/en.yml b/languages/en.yml index e6c7469b..154e9447 100644 --- a/languages/en.yml +++ b/languages/en.yml @@ -676,3 +676,9 @@ announcements_message_type_standard: Standard announcements_message_type_announcement: Announcement announcements_message_type_highlight: Highlight announcements_message_type_warning: Warning + +converse_theme_warning_description: | + + It is strongly recommanded to keep the "Peertube theme", in combinaison with the "Automatic color detection" feature. + Otherwise some user may experience issues depending on the Peertube theme they use. + diff --git a/server/lib/settings.ts b/server/lib/settings.ts index 8c8bd19c..ef698a8e 100644 --- a/server/lib/settings.ts +++ b/server/lib/settings.ts @@ -532,7 +532,6 @@ function initThemingSettings ({ registerSetting }: RegisterServerOptions): void ] as Array<{ value: ConverseJSTheme, label: string }>, descriptionHTML: loc('converse_theme_description') }) - registerSetting({ name: 'converse-autocolors', label: loc('autocolors_label'), @@ -541,6 +540,12 @@ function initThemingSettings ({ registerSetting }: RegisterServerOptions): void private: false, descriptionHTML: loc('autocolors_description') }) + registerSetting({ + name: 'converse-theme-warning', + type: 'html', + private: true, + descriptionHTML: loc('converse_theme_warning_description') + }) registerSetting({ name: 'chat-style',