immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
49.53k stars 2.61k forks source link

Web: Shared links back navigation button navigates to wrong page #11985

Open Snowknight26 opened 2 months ago

Snowknight26 commented 2 months ago

The bug

The back/close button on the Shared links page seems to be hard-coded to always go back to /sharing instead of where you previously were.

The OS that Immich Server is running on

Windows 10 22H2 (19045.4780)

Version of Immich Server

v1.112.1

Version of Immich Mobile App

N/A

Platform with the issue

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

  1. Go to Photos
  2. Click on a photo
  3. Click the triple dots on the top navigation bar
  4. Click Add to album
  5. Click New Album
  6. Click View Album in the toast, or click the album in the Info bar
  7. Click Share in the top nav bar
  8. Click Create link
  9. Click Create link
  10. Close the modal
  11. Click Share in the top nav bar
  12. Click View links
  13. Click the Close button (back icon) in the top nav bar

You should be back on the album, not back on Sharing

Relevant log output

No response

Additional information

No response

Pranay-Pandey commented 2 days ago

@jrasm91 Can you please suggest if this is the correct way to handle this? I see your comment

  // The GalleryViewer pushes it's own history state, which causes weird
  // behavior for history.back(). To prevent that we store the previous page
  // manually and navigate back to that.

Would using history.back() in albums/album-id be bad?

Or is this redirect hardcoded in sharing/sharedlinks for some reason?