Skip to content

Commit

Permalink
Prefer default viewer meta on history push
Browse files Browse the repository at this point in the history
  • Loading branch information
djblue committed Aug 11, 2024
1 parent 6953d2d commit d0dc39d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/portal/ui/state.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
(take 100 (conj (remove #{entry} (::previous-commands state)) entry))))))

(defn- push-viewer [state {:keys [context] :portal/keys [value]}]
(if-let [viewer (or (get-in state [:selected-viewers (get-location context)])
(some-> value meta :portal.viewer/default))]
(if-let [viewer (or (some-> value meta :portal.viewer/default)
(get-in state [:selected-viewers (get-location context)]))]
(assoc-in state [:selected-viewers {:stable-path [] :value value}] viewer)
state))

Expand Down

0 comments on commit d0dc39d

Please sign in to comment.