fix(editor): handle save editing block timestamp

Fix #8238
This commit is contained in:
Andelf
2023-01-13 12:33:58 +08:00
parent 8a1da89ef5
commit cfe28ca88a
2 changed files with 24 additions and 6 deletions

View File

@@ -97,12 +97,17 @@
text (repeated/timestamp-map->text timestamp)
block-data (state/get-timestamp-block)
{:keys [block typ show?]} block-data
editing-block-id (:block/uuid (state/get-edit-block))
block-id (or (:block/uuid block)
(:block/uuid (state/get-edit-block)))
editing-block-id)
typ (or @commands/*current-command typ)]
(editor-handler/set-block-timestamp! block-id
typ
text)
(if (and (state/editing?) (= editing-block-id block-id))
(editor-handler/set-editing-block-timestamp! typ
text)
(editor-handler/set-block-timestamp! block-id
typ
text))
(when show?
(reset! show? false)))
(clear-timestamp!)