You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-08 23:07:32 +02:00
Chore: Make useFormNote.test.ts less likely to fail in CI (#12014)
This commit is contained in:
@@ -97,7 +97,15 @@ const useRefreshFormNoteOnChange = (formNoteRef: RefObject<FormNote>, editorId:
|
||||
|
||||
await initNoteState(n, false);
|
||||
if (event.cancelled) return;
|
||||
setFormNoteRefreshScheduled(0);
|
||||
setFormNoteRefreshScheduled(oldValue => {
|
||||
// If a new refresh was scheduled between initNoteState
|
||||
// and now:
|
||||
if (oldValue !== formNoteRefreshScheduled) {
|
||||
return oldValue;
|
||||
}
|
||||
// A refresh is no longer scheduled
|
||||
return 0;
|
||||
});
|
||||
};
|
||||
|
||||
await loadNote();
|
||||
|
||||
Reference in New Issue
Block a user