Skip to content

Commit 86bffd5

Browse files
committed
refactor: . Extract variable needToForceCheckedProperty for clarity
1 parent 989f11b commit 86bffd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Obsidian/LivePreviewExtension.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ class LivePreviewExtension implements PluginValue {
9898
// updates correctly.
9999
// As a "fix", we set the checkbox's `checked` state *explicitly* after a
100100
// timeout in case we need to revert Obsidian's possibly wrongful reversal.
101-
if (toggled.length === 1) {
101+
const needToForceCheckedProperty = toggled.length === 1;
102+
if (needToForceCheckedProperty) {
102103
// The smoke tests show the workaround is only needed when the event replaces
103104
// a single task line.
104105
// (When one task line becomes two because of recurrence, both the

0 commit comments

Comments
 (0)