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(web): add debounce to location search #9074

Merged
merged 7 commits into from
Apr 26, 2024

Conversation

nghduc97
Copy link
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.

@martabal
Copy link
Member

Can't we just abort the previous request ?

isSearching = false;
showSpinner = false;
if (latestSearchTimeout) {
clearTimeout(latestSearchTimeout);
Copy link
Contributor Author

@nghduc97 nghduc97 Apr 26, 2024

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
Member

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.

@alextran1502 alextran1502 merged commit 59537f8 into immich-app:main Apr 26, 2024
22 checks passed
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.

None yet

4 participants