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

docs: add-hash #15860 follow-up #15988

Conversation

NicholasFlamy
Copy link
Member

@NicholasFlamy NicholasFlamy commented Feb 10, 2025

Description

Adds hash to URL.
I forgot to do this in the original PR #15860. Sorry about that.

How Has This Been Tested?

  • Tested in dev environment with npm run start for docs.

Screenshots (if appropriate)

image

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services)

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 10, 2025
@NicholasFlamy NicholasFlamy force-pushed the docs-version-switcher-use-current-path branch from 6ae6c98 to 2b542d9 Compare February 10, 2025 01:06
@NicholasFlamy NicholasFlamy marked this pull request as ready for review February 10, 2025 01:23
@bo0tzz
Copy link
Member

bo0tzz commented Feb 10, 2025

Maybe instead of manual concatenation, use https://developer.mozilla.org/en-US/docs/Web/API/URL. I would expect that to handle all of these details.

@jrasm91
Copy link
Contributor

jrasm91 commented Feb 10, 2025

new URL(location.href, url).href should do it I think

@NicholasFlamy
Copy link
Member Author

NicholasFlamy commented Feb 10, 2025

new URL(location.href, url).href should do it I think

I'll have to test, but I'm not sure that will work based on the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/URL/URL

new URL(url, base)

If url is an absolute URL, a given base will not be used to create the resulting URL.

Edit: undo edit.

Edit 2: I don't see any easy way to do this as location.href returns the absolute URL. The won't work for new URL(url, base) because we need a relative reference, and that goes back to location.pathname + location.hash. Theoretically you could use location.pathname + location.hash inside new URL(url, base) but then you're just concatenating into it. Unless that constructor is somehow more optimized than a regular concatenation, I'm not sure what it would accomplish.

@alextran1502 alextran1502 merged commit 4cad23a into immich-app:main Feb 10, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:skip documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants