Skip to content

fix(web): delete modal z-index - #5416

Merged
jrasm91 merged 1 commit into
immich-app:mainfrom
danielktaylor:fix/trash-photo
Dec 5, 2023
Merged

jrasm91 merged 1 commit into
immich-app:mainfrom
danielktaylor:fix/trash-photo

Conversation

@danielktaylor

Copy link
Copy Markdown
Contributor

This fixes #4954

When trashing a photo, it should move to the next photo automatically. If there is no next photo, then the previous photo, and otherwise close the asset viewer. This matches Google Photos behavior.

The current code does not work because the deleted photo's next asset reference is null after the deleteAssets(...) call.

I'm new to Svelte, all code suggestions are welcome.

@danielktaylor

danielktaylor commented Dec 2, 2023 •

Copy link
Copy Markdown
Contributor Author

Just added a fix for deleting photos, too, in addition to trashing.

I increased the z-index on the delete confirmation modal, because it's currently behind the photo:

Screenshot from 2023-12-01 21-48-46

Comment on lines +380 to +386
if (nextAsset) {
assetViewingStore.setAssetId(nextAsset);
} else if (previousAsset) {
assetViewingStore.setAssetId(previousAsset);
} else {
closeViewer();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we cannot put this logic inside of navigateAssetForward()?

@jrasm91

jrasm91 commented Dec 5, 2023

Copy link
Copy Markdown
Member

It turns out the issue is because of the websocket event, which I fixed in #5493 instead. Also, the code already had logic for next || previous || close viewer in the asset-grid component #5488 re-uses that same logic for trash and delete.

The delete modal is a good catch, so I've rebased this PR to include that fix.

@jrasm91
jrasm91 enabled auto-merge (squash) December 5, 2023 01:31
@jrasm91
jrasm91 disabled auto-merge December 5, 2023 01:31
@jrasm91
jrasm91 enabled auto-merge (squash) December 5, 2023 01:32
@jrasm91 jrasm91 changed the title fix(web): trashing should auto move to next photo fix(web): delete modal z-index Dec 5, 2023
@jrasm91
jrasm91 merged commit 933c24e into immich-app:main Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] web: trashing asset doen't shift to next asset and browsing does't work anymore

2 participants