Skip to content

Commit

Permalink
Only set Dark Mode if Dark Mode hasn't already been forced (#57)
Browse files Browse the repository at this point in the history
Adding this change allows the user to force dark mode for any of the custom themes, hiding the dark mode switcher on the user menu
  • Loading branch information
Jamesking56 authored Jun 14, 2024
1 parent 57e2638 commit 8c38ba1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Http/Middleware/SetTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public function handle(Request $request, Closure $next): Response
},
], 'hasnayeen/themes');

$panel->darkMode(! $currentTheme instanceof HasOnlyLightMode, $currentTheme instanceof HasOnlyDarkMode);
if (!$panel->hasDarkModeForced()) {
$panel->darkMode(! $currentTheme instanceof HasOnlyLightMode, $currentTheme instanceof HasOnlyDarkMode);
}

if ($currentTheme instanceof CanModifyPanelConfig) {
$currentTheme->modifyPanelConfig($panel);
Expand Down

0 comments on commit 8c38ba1

Please sign in to comment.