mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 16:25:51 +01:00
added today launcher
This commit is contained in:
@@ -32,12 +32,13 @@ export default class NoteLauncher extends AbstractLauncher {
|
||||
}
|
||||
|
||||
async launch(evt) {
|
||||
const targetNoteId = this.getTargetNoteId();
|
||||
// await because subclass overrides can be async
|
||||
const targetNoteId = await this.getTargetNoteId();
|
||||
if (!targetNoteId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const hoistedNoteId = this.getHoistedNoteId();
|
||||
const hoistedNoteId = await this.getHoistedNoteId();
|
||||
|
||||
if (!evt) {
|
||||
// keyboard shortcut
|
||||
|
||||
15
src/public/app/widgets/buttons/launcher/today_launcher.js
Normal file
15
src/public/app/widgets/buttons/launcher/today_launcher.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import NoteLauncher from "./note_launcher.js";
|
||||
import dateNotesService from "../../../services/date_notes.js";
|
||||
import appContext from "../../../components/app_context.js";
|
||||
|
||||
export default class TodayLauncher extends NoteLauncher {
|
||||
async getTargetNoteId() {
|
||||
const todayNote = await dateNotesService.getTodayNote();
|
||||
|
||||
return todayNote.noteId;
|
||||
}
|
||||
|
||||
getHoistedNoteId() {
|
||||
return appContext.tabManager.getActiveContext().hoistedNoteId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user