Skip to content

Commit

Permalink
Merge pull request #50 from kenepa/fix-language-switcher-currentlang-…
Browse files Browse the repository at this point in the history
…issue

Fixed: Language switcher causes problems if the active language is no…
  • Loading branch information
Jehizkia authored Jun 7, 2024
2 parents c59a634 + 601587c commit 78d44dd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions resources/views/language-switcher.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function try_svg($name, $classes) {
])
>
<span class="opacity-100">
@if ($showFlags)
@if (isset($currentLanguage) && $showFlags)
{{ try_svg('flag-1x1-'.$currentLanguage['flag'], 'rounded-full w-8 h-8') }}
@else
<x-icon
Expand All @@ -44,7 +44,12 @@ class="w-5 h-5"

<x-filament::dropdown.list>
@foreach ($otherLanguages as $language)
@php $isCurrent = $currentLanguage['code'] === $language['code']; @endphp
@php
$isCurrent = false;
if (isset($currentLanguage)) {
$isCurrent = $currentLanguage['code'] === $language['code'];
}
@endphp
<x-filament::dropdown.list.item>
<a
@class([
Expand Down

0 comments on commit 78d44dd

Please sign in to comment.