refactor: 💡 refactor serval event names

refactore serval event names to follow the current usage in repo
This commit is contained in:
Jin 2025-03-03 23:15:58 +01:00
parent a9d8d7d3c5
commit c9c18146f4
5 changed files with 5 additions and 8 deletions

View File

@ -303,9 +303,6 @@ type EventMappings = {
setNoteContext: {
noteContext: NoteContext;
};
noteTypeMimeChangedEvent: {
noteId: string;
};
reEvaluateHighlightsListWidgetVisibility: {
noteId: string | undefined;
};
@ -333,7 +330,7 @@ type EventMappings = {
noteDetailRefreshed: {
ntxId?: string | null;
};
noteContextReorderEvent: {
noteContextReorder: {
oldMainNtxId: string;
newMainNtxId: string;
ntxIdsInOrder: string[];

View File

@ -12,7 +12,7 @@ export default class ClosePaneButton extends OnClickButtonWidget {
);
}
async noteContextReorderEvent({ ntxIdsInOrder }: EventData<"noteContextReorderEvent">) {
async noteContextReorderEvent({ ntxIdsInOrder }: EventData<"noteContextReorder">) {
this.refresh();
}

View File

@ -85,7 +85,7 @@ export default class CodeButtonsWidget extends NoteContextAwareWidget {
this.$openTriliumApiDocsButton.toggle(note.mime.startsWith("application/javascript;env="));
}
async noteTypeMimeChangedEvent({ noteId }: EventData<"noteTypeMimeChangedEvent">) {
async noteTypeMimeChangedEvent({ noteId }: EventData<"noteTypeMimeChanged">) {
if (this.isNote(noteId)) {
await this.refresh();
}

View File

@ -119,7 +119,7 @@ class NoteContextAwareWidget extends BasicWidget {
this.noteContext = noteContext;
}
async noteTypeMimeChangedEvent({ noteId }: EventData<"noteTypeMimeChangedEvent">) {
async noteTypeMimeChangedEvent({ noteId }: EventData<"noteTypeMimeChanged">) {
if (this.isNote(noteId)) {
await this.refresh();
}

View File

@ -638,7 +638,7 @@ export default class TabRowWidget extends BasicWidget {
this.updateTabById(noteContext.mainNtxId || noteContext.ntxId);
}
noteContextReorderEvent({ oldMainNtxId, newMainNtxId }: EventData<"noteContextReorderEvent">) {
noteContextReorderEvent({ oldMainNtxId, newMainNtxId }: EventData<"noteContextReorder">) {
if (!oldMainNtxId || !newMainNtxId) {
// no need to update tab row
return;