Skip to content

Commit

Permalink
improve handling of empty queues
Browse files Browse the repository at this point in the history
  • Loading branch information
dartungar committed Mar 31, 2024
1 parent 860048c commit 376bc34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "simple-note-review",
"name": "Simple Note Review",
"version": "1.2.4",
"version": "1.2.5",
"minAppVersion": "1.1.0",
"description": "Simple, customizable plugin for easy note review, resurfacing & repetition.",
"author": "dartungar",
Expand Down
11 changes: 3 additions & 8 deletions src/queues/reviewService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ export class ReviewService {
await this.openNextNoteInQueue(noteSet);
}



private async removeNoteFromQueue(
note: TAbstractFile,
noteSet: INoteSet
Expand All @@ -86,12 +84,9 @@ export class ReviewService {
}

private async openNextNoteInQueue(noteSet: INoteSet): Promise<void> {
const errorMsgBase = `Error opening next note in note set ${noteSet.displayName}: `;
if (
noteSet.queue?.filenames?.length &&
noteSet.queue?.filenames?.length === 0
) {
this._plugin.showNotice(errorMsgBase + "review queue is empty.");
const errorMsgBase = `Error opening next note in note set ${noteSet.displayName}: \n`;
if (!noteSet.queue?.filenames?.length) {
this._plugin.showNotice(errorMsgBase + "review queue is empty. Check note set in plugin settings.");
return;
}
const filePath = noteSet.queue.filenames[0];
Expand Down

0 comments on commit 376bc34

Please sign in to comment.