Skip to content

fix(web): add debounce to location search - #9074

Merged
alextran1502 merged 7 commits into
immich-app:mainfrom
nghduc97:debounce-for-location-search
Apr 26, 2024
Merged

alextran1502 merged 7 commits into
immich-app:mainfrom
nghduc97:debounce-for-location-search

Conversation

@nghduc97

Copy link
Copy Markdown
Contributor

The search input on change location dialog ignore changes when search is in place leading to issue #9061. This PR fixes it by adding debounce on the input.

Comment thread web/src/lib/components/shared-components/change-location.svelte Outdated
@martabal

Copy link
Copy Markdown
Contributor

Can't we just abort the previous request ?

isSearching = false;
showSpinner = false;
if (latestSearchTimeout) {
clearTimeout(latestSearchTimeout);

@nghduc97 nghduc97 Apr 26, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can't we just abort the previous request ?

@martabal Yes, abort if no requests have been sent, if already sent then ignore the result.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, I mean using an AbortController. The timeout is used to avoid the loading spinner from blinking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants