You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Plugins: Only call onNoteChange for the current note
Otherwise it could mean hundreds of updates when notes are being imported or during sync.
This commit is contained in:
@ -76,11 +76,12 @@ export default class JoplinWorkspace {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the content of a note changes.
|
||||
* Called when the content of the current note changes.
|
||||
*/
|
||||
public async onNoteChange(handler: ItemChangeHandler): Promise<Disposable> {
|
||||
const wrapperHandler = (event: any) => {
|
||||
if (event.itemType !== ModelType.Note) return;
|
||||
if (!this.store.getState().selectedNoteIds.includes(event.itemId)) return;
|
||||
|
||||
handler({
|
||||
id: event.itemId,
|
||||
|
Reference in New Issue
Block a user