Skip to content

Commit

Permalink
RequestManager make requests abortable - Fix missed usages (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
schroda authored May 23, 2023
1 parent c32cb53 commit 606ee9d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/components/ExtensionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}"`);
Expand Down
2 changes: 1 addition & 1 deletion src/components/library/UpdateChecker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/screens/DownloadQueue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/screens/settings/LibrarySettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 606ee9d

Please sign in to comment.