-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When marking a to-do as completed there's a slight delay before the list is updated #10203
Comments
Which OS has this issue? I run joplin on Arch Linux and it is working instantly for me. |
All of them probably |
The only probable reason I could find is that the const noteItem_checkboxClick = async (event: any, item: any) => {
const checked = event.target.checked;
const newNote = {
id: item.id,
todo_completed: checked ? time.unixMs() : 0,
};
await Note.save(newNote, { userSideValidation: true });
eventManager.emit(EventName.TodoToggle, { noteId: item.id, note: newNote });
}; |
@DarkFalc0n - so just interchanging the two lines should fix it? |
Interchanging could lead to other cases of bad error handling where there is an exception and the note state couldn't be saved but the check will still update. The current order of functions makes more sense since any error in saving the note can be reflected even before updating the list (and the check mark) |
It needs more thought to be put into it |
@DarkFalc0n, I think you could interchange them & add e.g. eventManager.emit(EventName.TodoToggle, { noteId: item.id, note: newNote });
try {
await Note.save(newNote, { userSideValidation: true });
} catch(e) {
eventManager.emit(EventName.TodoToggle, { noteId: item.id, note: newNote });
} Maybe re-throw the error if needed. |
This could definitely work, lets see what others think of this |
Actually, I'm not sure if this particular |
That's right, we'll need to remove NoteList.tsx. I kept it there for some time just in case there's a major issue with the new note list |
There's a similar logic in joplin/packages/app-desktop/gui/NoteListItem/NoteListItem.tsx Lines 53 to 59 in 06aa640
But I'm not sure if it's really what's causing this behaviour, I added few |
I can't replicate it on dev anymore |
It should be updated immediately (like on mobile?)
The text was updated successfully, but these errors were encountered: