Skip to content

Commit

Permalink
fix(unlinked-refs): update unlinked refs when page changes (#1195)
Browse files Browse the repository at this point in the history
Co-authored-by: jeff <[email protected]>
  • Loading branch information
datokrat and tangjeff0 committed May 20, 2021
1 parent b635da0 commit 5d7b0fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cljs/athens/views/pages/node_page.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,13 @@
Similar to atom-string in blocks. Hacky, but state consistency is hard!"
[_ _ _ _]
(let [state (r/atom init-state)
unlinked-refs (r/atom [])]
unlinked-refs (r/atom [])
block-uid (r/atom nil)]
(fn [node editing-uid linked-refs]
(when (not= @block-uid (:block/uid node))
(reset! state init-state)
(reset! unlinked-refs [])
(reset! block-uid (:block/uid node)))
(let [{:block/keys [children uid] title :node/title} node
{:alert/keys [message confirm-fn cancel-fn] alert-show :alert/show} @state
daily-note? (is-daily-note uid)
Expand Down

0 comments on commit 5d7b0fe

Please sign in to comment.