Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error cover option when selecting photo in smart album #2430

Merged
merged 1 commit into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading