Skip to content

Commit c5223ba

Browse files
committed
refactor: . Extract variable replacementTextIsNonEmpty
1 parent 9ed9efa commit c5223ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Commands/ToggleDone.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export const toggleDone = (checking: boolean, editor: Editor, view: MarkdownView
3737

3838
const insertion = toggleLine(line, path);
3939

40-
if (insertion.text.length > 0) {
40+
const replacementTextIsNonEmpty = insertion.text.length > 0;
41+
if (replacementTextIsNonEmpty) {
4142
editor.setLine(lineNumber, insertion.text);
4243
} else {
4344
// https://github.com/obsidian-tasks-group/obsidian-tasks/issues/3342

0 commit comments

Comments
 (0)