diff --git a/src/services/epub/import.ts b/src/services/epub/import.ts index 4fc8a2c12..2fe814822 100644 --- a/src/services/epub/import.ts +++ b/src/services/epub/import.ts @@ -18,6 +18,7 @@ import { BACKGROUND_ACTION, BackgoundAction } from '@services/constants'; import { getString } from '@strings/translations'; import { ChapterItem, SourceNovel } from '@plugins/types'; import { load as parseXML } from 'cheerio'; +import { showToast } from '@utils/showToast'; interface TaskData { delay: number; @@ -340,7 +341,8 @@ export const importEpub = async () => { copyToCacheDirectory: false, }); if (epubFile.type === 'cancel') { - throw new Error(getString('common.cancel')); + showToast(getString('common.cancel')); + return; } await BackgroundService.start(importEpubAction, { taskName: 'Import Epub',