mirror of
https://github.com/thelounge/thelounge
synced 2024-11-25 21:40:22 +00:00
Fix changing theme color and properly sync settings.
This commit is contained in:
parent
b5f2e7f0cc
commit
ee92de0ff7
2 changed files with 8 additions and 10 deletions
|
@ -481,7 +481,7 @@ export default {
|
|||
value = event.target.value;
|
||||
}
|
||||
|
||||
this.options.updateSetting(name, value);
|
||||
this.options.updateSetting(name, value, true);
|
||||
},
|
||||
changePassword() {
|
||||
const allFields = new FormData(this.$refs.settingsForm);
|
||||
|
|
|
@ -84,20 +84,18 @@ function updateDesktopNotificationStatus() {
|
|||
}
|
||||
|
||||
function applySetting(name, value) {
|
||||
if (name === "syncSettings" && value) {
|
||||
$syncWarningOverride.hide();
|
||||
$forceSyncButton.hide();
|
||||
} else if (name === "theme") {
|
||||
if (name === "theme") {
|
||||
const themeUrl = `themes/${value}.css`;
|
||||
|
||||
if ($theme.attr("href") !== themeUrl) {
|
||||
$theme.attr("href", themeUrl);
|
||||
|
||||
const newTheme = $settings.find("#theme-select option[value='" + value + "']");
|
||||
const newTheme = vueApp.serverConfiguration.themes.filter(
|
||||
(theme) => theme.name === value
|
||||
)[0];
|
||||
let themeColor = defaultThemeColor;
|
||||
|
||||
if (newTheme.length > 0 && newTheme[0].dataset.themeColor) {
|
||||
themeColor = newTheme[0].dataset.themeColor;
|
||||
if (newTheme.themeColor) {
|
||||
themeColor = newTheme.themeColor;
|
||||
}
|
||||
|
||||
document.querySelector('meta[name="theme-color"]').content = themeColor;
|
||||
|
@ -117,7 +115,7 @@ function settingSetEmit(name, value) {
|
|||
socket.emit("setting:set", {name, value});
|
||||
}
|
||||
|
||||
// When sync is `true` the setting will also be send to the backend for syncing.
|
||||
// When sync is `true` the setting will also be sent to the backend for syncing.
|
||||
function updateSetting(name, value, sync) {
|
||||
settings[name] = value;
|
||||
storage.set("settings", JSON.stringify(settings));
|
||||
|
|
Loading…
Reference in a new issue