reformat and store darkmode setting correct in db

This commit is contained in:
Lukas Heiligenbrunner 2020-07-29 23:00:37 +02:00
parent 8c4b1a836a
commit 827fd6a1b2
3 changed files with 10 additions and 7 deletions

View File

@ -29,13 +29,15 @@ if (isset($_POST['action'])) {
$videopath = $_POST['videopath'];
$tvshowpath = $_POST['tvshowpath'];
$tmdbsupport = $_POST['tmdbsupport'];
$darkmodeenabled = $_POST['darkmodeenabled'];
$query = "UPDATE settings SET
video_path='$videopath',
episode_path='$tvshowpath',
password='$password',
mediacenter_name='$mediacentername',
TMDB_grabbing=$tmdbsupport
TMDB_grabbing=$tmdbsupport,
DarkMode=$darkmodeenabled
WHERE 1";
if ($conn->query($query) === true) {

View File

@ -130,6 +130,7 @@ class GeneralSettings extends React.Component {
updateRequest.append('tvshowpath', this.state.tvshowpath);
updateRequest.append('mediacentername', this.state.mediacentername);
updateRequest.append("tmdbsupport", this.state.tmdbsupport);
updateRequest.append("darkmodeenabled", StaticInfos.isDarkTheme());
fetch('/api/Settings.php', {method: 'POST', body: updateRequest})
.then((response) => response.json()