1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-10 22:11:50 +02:00

Mobile: Fixes #12822: Fix switching between note and todo on mobile (#12849)

This commit is contained in:
mrjo118
2025-08-06 11:09:05 +01:00
committed by GitHub
parent 72f8ebe4ff
commit 82bc819a21
2 changed files with 4 additions and 6 deletions

View File

@@ -1043,9 +1043,9 @@ class NoteScreenComponent extends BaseScreenComponent<ComponentProps, State> imp
};
private toggleIsTodo_onPress() {
shared.toggleIsTodo_onPress(this);
const newNote = shared.toggleIsTodo_onPress(this);
this.scheduleSave(this.state);
this.scheduleSave({ ...this.state, note: newNote });
}
private async share_onPress() {

View File

@@ -76,7 +76,7 @@ interface Shared {
attachedResources?: (noteBody: string)=> Promise<any>;
isModified?: (comp: BaseNoteScreenComponent)=> boolean;
initState?: (comp: BaseNoteScreenComponent)=> Promise<void>;
toggleIsTodo_onPress?: (comp: BaseNoteScreenComponent)=> void;
toggleIsTodo_onPress?: (comp: BaseNoteScreenComponent)=> NoteEntity;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
toggleCheckboxRange?: (ipcMessage: string, noteBody: string)=> any;
toggleCheckbox?: (ipcMessage: string, noteBody: string)=> string;
@@ -360,9 +360,7 @@ shared.initState = async function(comp: BaseNoteScreenComponent) {
};
shared.toggleIsTodo_onPress = function(comp: BaseNoteScreenComponent) {
const newNote = Note.toggleIsTodo(comp.state.note);
const newState = { note: newNote };
comp.setState(newState);
return Note.toggleIsTodo(comp.state.note);
};
function toggleCheckboxLine(ipcMessage: string, noteBody: string) {