mirror of
https://github.com/logseq/logseq.git
synced 2026-05-03 02:16:30 +00:00
fix: set timestamp to another editing block
close https://github.com/logseq/logseq/issues/3783
This commit is contained in:
@@ -1040,13 +1040,15 @@
|
||||
value (str value)]
|
||||
(when-let [block (db/pull [:block/uuid block-id])]
|
||||
(let [{:block/keys [content]} block
|
||||
content (or (state/get-edit-content) content)
|
||||
content (or content (state/get-edit-content))
|
||||
new-content (-> (text/remove-timestamp content key)
|
||||
(text/add-timestamp key value))]
|
||||
(when (not= content new-content)
|
||||
(if-let [input-id (state/get-edit-input-id)]
|
||||
(state/set-edit-content! input-id new-content)
|
||||
(save-block-if-changed! block new-content)))))))
|
||||
(let [input-id (state/get-edit-input-id)]
|
||||
(if (and input-id
|
||||
(string/ends-with? input-id (str block-id)))
|
||||
(state/set-edit-content! input-id new-content)
|
||||
(save-block-if-changed! block new-content))))))))
|
||||
|
||||
(defn- set-blocks-id!
|
||||
[block-ids]
|
||||
|
||||
Reference in New Issue
Block a user