Skip to content

Commit

Permalink
Fix dark mode toggle default value
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaszkadziela committed Nov 2, 2024
1 parent 4accf94 commit f3df691
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/components/dark-mode-toggle.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<x-input.toggle x-data="{ checked: ('{{ $value }}' === '' ? window.matchMedia('(prefers-color-scheme: light)').matches : {{ $value === 'light' ? 'true' : 'false' }}) }"
x-bind:value="checked"
:checked="$value"
:checked="$value === 'light'"
size="lg"
@change="checked = $event.target.checked; window.location = `{{ action([UserSettingController::class, 'theme'], ['mode' => '/']) }}/${checked ? 'light' : 'dark'}`;"
>
Expand Down

0 comments on commit f3df691

Please sign in to comment.