RequestManager make requests abortable - Fix missed usages (#318)
This commit is contained in:
@@ -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}"`);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user