mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Enable night mode on /login if that's the system preferred color scheme (references #71)
This commit is contained in:
parent
4659f51551
commit
15ab198af0
@ -57,6 +57,7 @@
|
||||
|
||||
### General
|
||||
|
||||
- Night mode is now also used on the login page if that's the system preferred color scheme (generally if night mode is on or not is based on user settings and before logging in no user context is available)
|
||||
- Optimized sidebar icon spacing (thanks @chris-thorn)
|
||||
- Fixed that file uploads (product pictures and so on) didn't work for files where the file name contains multiple spaces
|
||||
- Fixed that some dialogs were not properly (too small) displayed in Firefox >= 121
|
||||
|
@ -49,9 +49,9 @@ $("#auto-night-mode-time-range-goes-over-midgnight").on("change", function()
|
||||
|
||||
function CheckNightMode()
|
||||
{
|
||||
if (Grocy.UserId === -1)
|
||||
if (Grocy.UserId === -1) // Not logged in => always use system preferred color scheme
|
||||
{
|
||||
return;
|
||||
Grocy.UserSettings.night_mode = "follow-system";
|
||||
}
|
||||
|
||||
var nightModeEnabledInternalBefore = Grocy.UserSettings.night_mode_enabled_internal;
|
||||
@ -132,8 +132,6 @@ if (Grocy.UserId !== -1)
|
||||
$("#auto-night-mode-time-range-from").trigger("keyup");
|
||||
$("#auto-night-mode-time-range-to").val(Grocy.UserSettings.auto_night_mode_time_range_to);
|
||||
$("#auto-night-mode-time-range-to").trigger("keyup");
|
||||
|
||||
CheckNightMode();
|
||||
}
|
||||
|
||||
if (Grocy.Mode === "production")
|
||||
@ -144,3 +142,5 @@ else
|
||||
{
|
||||
setInterval(CheckNightMode, 4000);
|
||||
}
|
||||
|
||||
CheckNightMode();
|
||||
|
Loading…
x
Reference in New Issue
Block a user