Handle track search error

Apollo fails to handle changes in the options context (e.g. abort controller) which causes the request to infinitely re-trigger on errors.

By not adding an abort controller, this gets prevented, however, it prevents the search to be aborted on e.g. changing the search string
This commit is contained in:
schroda
2024-10-06 16:20:50 +02:00
parent 6e9fdee0bb
commit e707e7b7da

View File

@@ -53,7 +53,9 @@ export const TrackerSearch = ({
const [selectedTrackerRemoteId, setSelectedTrackerRemoteId] = useState<string | undefined>(trackedId);
const trackerSearch = requestManager.useTrackerSearch(tracker.id, searchString, { addAbortSignal: true });
const trackerSearch = requestManager.useTrackerSearch(tracker.id, searchString, {
notifyOnNetworkStatusChange: true,
});
const searchResults = trackerSearch.data?.searchTracker.trackSearches ?? [];
const hasResults = !!searchResults.length;