fix: prevent spinner from hiding on specific response headers
- Updated responseHandler in useAxios hook to conditionally hide the spinner only when the 'spinner-state' header is undefined.
This commit is contained in:
parent
a7ea7ce4bc
commit
3e8e08c3eb
@ -9,7 +9,9 @@ export function useAxios() {
|
||||
}
|
||||
|
||||
const responseHandler = (response: AxiosResponse) => {
|
||||
useSpinnerStore.getState().setIsShow(false)
|
||||
if (response.headers['spinner-state'] === undefined) {
|
||||
useSpinnerStore.getState().setIsShow(false)
|
||||
}
|
||||
response.data = transferResponse(response)
|
||||
return response
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user