RequestManager make requests abortable - Fix missed usages (#318)

This commit is contained in:
schroda
2023-05-23 13:54:14 +02:00
committed by GitHub
parent c32cb53592
commit 606ee9de2d
4 changed files with 8 additions and 8 deletions

View File

@@ -87,13 +87,13 @@ export default function ExtensionCard(props: IProps) {
setInstalledState(state);
switch (action) {
case ExtensionAction.INSTALL:
await requestManager.installExtension(pkgName);
await requestManager.installExtension(pkgName).response;
break;
case ExtensionAction.UNINSTALL:
await requestManager.uninstallExtension(pkgName);
await requestManager.uninstallExtension(pkgName).response;
break;
case ExtensionAction.UPDATE:
await requestManager.updateExtension(pkgName);
await requestManager.updateExtension(pkgName).response;
break;
default:
throw new Error(`Unexpected ExtensionAction "${action}"`);

View File

@@ -46,7 +46,7 @@ function UpdateChecker({ handleFinishedUpdate }: IUpdateCheckerProps) {
try {
setLoading(true);
setProgress(0);
await requestManager.startGlobalUpdate();
await requestManager.startGlobalUpdate().response;
} catch (e) {
makeToast(t('global.error.label.update_failed'), 'error');
setLoading(false);

View File

@@ -67,15 +67,15 @@ const DownloadQueue: React.FC = () => {
try {
if (isRunning) {
// required to stop before deleting otherwise the download kept going. Server issue?
await requestManager.stopDownloads();
await requestManager.stopDownloads().response;
}
await Promise.all([
// remove from download queue
requestManager.removeChapterFromDownloadQueue(chapter.mangaId, chapter.index),
requestManager.removeChapterFromDownloadQueue(chapter.mangaId, chapter.index).response,
// delete partial download, should be handle server side?
// bug: The folder and the last image downloaded are not deleted
requestManager.deleteDownloadedChapter(chapter.mangaId, chapter.index),
requestManager.deleteDownloadedChapter(chapter.mangaId, chapter.index).response,
]);
} catch (error) {
makeToast(t('download.queue.error.label.failed_to_remove'), 'error');

View File

@@ -111,7 +111,7 @@ export default function LibrarySettings() {
);
const updateCategory = (category: ICategory) =>
requestManager.updateCategory(category.id, { includeInUpdate: category.includeInUpdate });
requestManager.updateCategory(category.id, { includeInUpdate: category.includeInUpdate }).response;
const updateCategories = async () => {
const categoriesToUpdate = dialogCategories.filter((category) => {