Skip to content

Commit

Permalink
showToast if cancel epub
Browse files Browse the repository at this point in the history
  • Loading branch information
nyagami committed Feb 21, 2024
1 parent 9495d50 commit e72fb95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/services/epub/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<TaskData>(importEpubAction, {
taskName: 'Import Epub',
Expand Down

0 comments on commit e72fb95

Please sign in to comment.