Fix/deprioritize image requests (#638)
* Use "fetch" instead of "axios"
Axios does not support prioritizing requests
* Deprioritize image requests
The browser requests images (<img>) with low priority by default.
Due to switching to loading images via axios (f852ce70e7), the image requests had the same priority as other requests and thus blocked e.g. xhr requests
This commit is contained in:
@@ -14,7 +14,6 @@ import { Theme, SxProps, Stack, Button } from '@mui/material';
|
||||
import BrokenImageIcon from '@mui/icons-material/BrokenImage';
|
||||
import RefreshIcon from '@mui/icons-material/Refresh';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { CanceledError } from 'axios';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
|
||||
|
||||
@@ -72,7 +71,7 @@ export const SpinnerImage = forwardRef((props: IProps, imgRef: ForwardedRef<HTML
|
||||
updateImageState(true);
|
||||
await updateImage();
|
||||
} catch (e) {
|
||||
const wasAborted = e instanceof CanceledError;
|
||||
const wasAborted = e instanceof Error && e.name === 'AbortError';
|
||||
updateImageState(false, !wasAborted);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user