Skip to content

Commit

Permalink
Fix error cover option when selecting photo in smart album (#2430)
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria authored May 12, 2024
1 parent f8f9542 commit 7b70049
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Livewire/Components/Menus/PhotoDropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class PhotoDropdown extends Component
#[Locked] public array $params;
#[Locked] public bool $is_starred;
#[Locked] public bool $is_header;
#[Locked] public bool $is_model_album;
/**
* mount info and load star condition.
*
Expand All @@ -44,6 +45,7 @@ public function mount(array $params): void

$this->params = $params;
$this->is_starred = Photo::query()->findOrFail($params[Params::PHOTO_ID])->is_starred;
$this->is_model_album = $album instanceof Album;
if ($album !== null) {
$this->is_header = $album->header_id === $params[Params::PHOTO_ID];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<x-context-menu.item wire:click='unstar' icon='star'>{{ __('lychee.UNSTAR') }}</x-context-menu.item>
@endif
<x-context-menu.item wire:click='tag' icon='tag'>{{ __('lychee.TAG') }}</x-context-menu.item>
@if($is_model_album)
<x-context-menu.item wire:click='setAsCover' icon='folder-cover'>{{ __('lychee.SET_COVER') }}</x-context-menu.item>
@endif
@if($is_header === false)
<x-context-menu.item wire:click='setAsHeader' icon='image'>{{ __('lychee.SET_HEADER') }}</x-context-menu.item>
@elseif($is_header)
Expand Down

0 comments on commit 7b70049

Please sign in to comment.