mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 16:55:50 +01:00
chore(prettier): fix all files
This commit is contained in:
@@ -8,14 +8,12 @@ import NoteContext from "../components/note_context.js";
|
||||
* @extends {BasicWidget}
|
||||
*/
|
||||
class NoteContextAwareWidget extends BasicWidget {
|
||||
|
||||
protected noteContext?: NoteContext;
|
||||
|
||||
isNoteContext(ntxId: string | null | undefined) {
|
||||
if (Array.isArray(ntxId)) {
|
||||
return this.noteContext && ntxId.includes(this.noteContext.ntxId);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return this.noteContext && this.noteContext.ntxId === ntxId;
|
||||
}
|
||||
}
|
||||
@@ -74,8 +72,7 @@ class NoteContextAwareWidget extends BasicWidget {
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
this.toggleInt(false);
|
||||
}
|
||||
}
|
||||
@@ -85,7 +82,7 @@ class NoteContextAwareWidget extends BasicWidget {
|
||||
*/
|
||||
async refreshWithNote(note: FNote | null | undefined) {}
|
||||
|
||||
async noteSwitchedEvent({noteContext, notePath}: EventData<"noteSwitched">) {
|
||||
async noteSwitchedEvent({ noteContext, notePath }: EventData<"noteSwitched">) {
|
||||
this.noteContext = noteContext;
|
||||
// if notePath does not match, then the noteContext has been switched to another note in the meantime
|
||||
if (noteContext.notePath === notePath) {
|
||||
@@ -97,7 +94,7 @@ class NoteContextAwareWidget extends BasicWidget {
|
||||
await this.refresh();
|
||||
}
|
||||
|
||||
async activeContextChangedEvent({noteContext}: EventData<"activeContextChanged">) {
|
||||
async activeContextChangedEvent({ noteContext }: EventData<"activeContextChanged">) {
|
||||
this.noteContext = noteContext;
|
||||
|
||||
await this.activeContextChanged();
|
||||
@@ -108,7 +105,7 @@ class NoteContextAwareWidget extends BasicWidget {
|
||||
}
|
||||
|
||||
// when note is both switched and activated, this should not produce a double refresh
|
||||
async noteSwitchedAndActivatedEvent({noteContext, notePath}: EventData<"noteSwitchedAndActivatedEvent">) {
|
||||
async noteSwitchedAndActivatedEvent({ noteContext, notePath }: EventData<"noteSwitchedAndActivatedEvent">) {
|
||||
this.noteContext = noteContext;
|
||||
|
||||
// if notePath does not match, then the noteContext has been switched to another note in the meantime
|
||||
@@ -117,12 +114,12 @@ class NoteContextAwareWidget extends BasicWidget {
|
||||
}
|
||||
}
|
||||
|
||||
setNoteContextEvent({noteContext}: EventData<"setNoteContext">) {
|
||||
setNoteContextEvent({ noteContext }: EventData<"setNoteContext">) {
|
||||
/** @var {NoteContext} */
|
||||
this.noteContext = noteContext;
|
||||
}
|
||||
|
||||
async noteTypeMimeChangedEvent({noteId}: EventData<"noteTypeMimeChangedEvent">) {
|
||||
async noteTypeMimeChangedEvent({ noteId }: EventData<"noteTypeMimeChangedEvent">) {
|
||||
if (this.isNote(noteId)) {
|
||||
await this.refresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user