Skip to content

Commit

Permalink
Refactor Notes interface and update related logic to use 'path' inste…
Browse files Browse the repository at this point in the history
…ad of 'file' #23
  • Loading branch information
estruyf committed Jan 5, 2025
1 parent a3e07e6 commit 5b4d197
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/models/Demos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export interface Demo {
}

export interface Notes {
file: string;
show?: boolean;
path: string;
showOnTrigger?: boolean;
}

export interface Icons {
Expand Down
4 changes: 2 additions & 2 deletions src/panels/DemoPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class DemoPanel {
ctxValue = "demo-time.lastStep";
}

const hasNotes = notesFolder && demo.notes?.file ? true : false;
const hasNotes = notesFolder && demo.notes?.path ? true : false;
if (hasNotes) {
ctxValue += " demo-time.hasNotes";
}
Expand Down Expand Up @@ -129,7 +129,7 @@ export class DemoPanel {
undefined,
parseWinPath(path),
idx,
demo.notes?.file
demo.notes?.path
);
});

Expand Down
4 changes: 2 additions & 2 deletions src/services/NotesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export class NotesService {
}

public static async showNotes(demo: Demo) {
if (demo.notes && demo.notes.file && demo.notes.show) {
NotesService.openNotes(demo.notes.file);
if (demo.notes && demo.notes.path && demo.notes.showOnTrigger) {
NotesService.openNotes(demo.notes.path);
}
}

Expand Down

0 comments on commit 5b4d197

Please sign in to comment.