💄 Add minor cosmetic improvements on dashboard ui component

This commit is contained in:
Andrey Antukh 2023-08-10 11:07:47 +02:00
parent e5dedb1e3d
commit 5d5d238fec

View file

@ -154,18 +154,18 @@
(hooks/use-shortcuts ::dashboard sc/shortcuts) (hooks/use-shortcuts ::dashboard sc/shortcuts)
(mf/with-effect [team-id] (mf/with-effect [team-id]
(st/emit! (dd/initialize {:id team-id}))) (st/emit! (dd/initialize {:id team-id}))
(mf/use-effect
(fn [] (fn []
(let [events [(events/listen goog/global "keydown" (dd/finalize {:id team-id})))
(mf/with-effect []
(let [key (events/listen goog/global "keydown"
(fn [event] (fn [event]
(when (kbd/enter? event) (when (kbd/enter? event)
(dom/stop-propagation event) (dom/stop-propagation event)
(st/emit! (dd/open-selected-file)))))]] (st/emit! (dd/open-selected-file)))))]
(fn [] (fn []
(doseq [key events] (events/unlistenByKey key))))
(events/unlistenByKey key))))))
[:& (mf/provider ctx/current-team-id) {:value team-id} [:& (mf/provider ctx/current-team-id) {:value team-id}
[:& (mf/provider ctx/current-project-id) {:value project-id} [:& (mf/provider ctx/current-project-id) {:value project-id}