-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed "no results" state flashing in some situations (#1266)
ref https://linear.app/tryghost/issue/MOM-160 In Ghost's Ember host app, promises ("tasks") can be cancelled which will occur when the searchLinks function is called in quick succession. That was resulting in a flash of "no results" because promises in React/plain JS don't get cancelled so earlier search promises could end up overwriting the results array whilst a later search was still completing. - added handling for receiving `undefined` from the `searchLinks` function which indicates a cancelled search - fixed constant re-creation of search options object prop which caused problems in the hook when it's properties were used in dependency arrays
- Loading branch information
1 parent
32ee16a
commit e490ae9
Showing
2 changed files
with
18 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters