Skip to content

Commit

Permalink
fix: get correct locale when user uses an inactive language
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Sep 26, 2022
1 parent b7d2a82 commit ae393b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public function share(Request $request): array
'locales' => fn () => [
'available' => locales(),
'active' => active_locales()->keys(),
'current' => app()->getLocale(),
'current' => active_locales()->has(app()->getLocale())
? app()->getLocale()
: active_locales()->keys()->first(),
],
'navigation' => fn () => $this->navigation($request),
'mediaLibrary' => fn () => $this->mediaLibraryConfig(),
Expand Down

0 comments on commit ae393b5

Please sign in to comment.