chore: only throws errors in usePayloadAPI if signal is not aborted
This commit is contained in:
@@ -65,8 +65,10 @@ const usePayloadAPI: UsePayloadAPI = (url, options = {}) => {
|
||||
setData(json);
|
||||
setIsLoading(false);
|
||||
} catch (error) {
|
||||
setIsError(true);
|
||||
setIsLoading(false);
|
||||
if (!abortController.signal.aborted) {
|
||||
setIsError(true);
|
||||
setIsLoading(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user