fix: clear all query state when re-render root ui

This commit is contained in:
Tienson Qin
2023-09-27 17:58:55 +08:00
parent 33aa5d841f
commit 854f4d3545

View File

@@ -79,19 +79,13 @@
(when-not (:srs/mode? @state/state)
(state/toggle-settings!)))
;; FIXME: re-render all embedded blocks since they will not be re-rendered automatically
(defn re-render-root!
([]
(re-render-root! {}))
([{:keys [clear-all-query-state?]
:or {clear-all-query-state? false}}]
([_opts]
{:post [(nil? %)]}
(when-let [component (state/get-root-component)]
(if clear-all-query-state?
(db/clear-query-state!)
(db/clear-query-state-without-refs-and-embeds!))
(db/clear-query-state!)
(rum/request-render component))
nil))