From 86bffd5b47e58579beffa81f4335955d017753b4 Mon Sep 17 00:00:00 2001 From: Clare Macrae Date: Sun, 27 Oct 2024 10:55:14 +0000 Subject: [PATCH] refactor: . Extract variable needToForceCheckedProperty for clarity --- src/Obsidian/LivePreviewExtension.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Obsidian/LivePreviewExtension.ts b/src/Obsidian/LivePreviewExtension.ts index 7fab4cf692..5ed6d50952 100644 --- a/src/Obsidian/LivePreviewExtension.ts +++ b/src/Obsidian/LivePreviewExtension.ts @@ -98,7 +98,8 @@ class LivePreviewExtension implements PluginValue { // updates correctly. // As a "fix", we set the checkbox's `checked` state *explicitly* after a // timeout in case we need to revert Obsidian's possibly wrongful reversal. - if (toggled.length === 1) { + const needToForceCheckedProperty = toggled.length === 1; + if (needToForceCheckedProperty) { // The smoke tests show the workaround is only needed when the event replaces // a single task line. // (When one task line becomes two because of recurrence, both the