prefs: reload on user theme change

This commit is contained in:
Andrew Dolgov 2018-12-07 10:35:46 +03:00
parent 7b0f4f1e46
commit 4fdcc923f0
1 changed files with 13 additions and 10 deletions

View File

@ -101,7 +101,8 @@ class Pref_Prefs extends Handler_Protected {
$value = $_POST[$pref_name]; $value = $_POST[$pref_name];
if ($pref_name == 'DIGEST_PREFERRED_TIME') { switch ($pref_name) {
case 'DIGEST_PREFERRED_TIME':
if (get_pref('DIGEST_PREFERRED_TIME') != $value) { if (get_pref('DIGEST_PREFERRED_TIME') != $value) {
$sth = $this->pdo->prepare("UPDATE ttrss_users SET $sth = $this->pdo->prepare("UPDATE ttrss_users SET
@ -109,12 +110,14 @@ class Pref_Prefs extends Handler_Protected {
$sth->execute([$_SESSION['uid']]); $sth->execute([$_SESSION['uid']]);
} }
} break;
case 'USER_LANGUAGE':
if (!$need_reload) $need_reload = $_SESSION["language"] != $value;
break;
if ($pref_name == "USER_LANGUAGE") { case 'USER_CSS_THEME':
if ($_SESSION["language"] != $value) { if (!$need_reload) $need_reload = get_pref($pref_name) != $value;
$need_reload = true; break;
}
} }
set_pref($pref_name, $value); set_pref($pref_name, $value);