mirror of
https://github.com/penpot/penpot.git
synced 2025-06-02 22:01:39 +02:00
🎉 Add comments to viewer.
This commit is contained in:
parent
e1db6d3a37
commit
64a6ba1949
45 changed files with 1629 additions and 1074 deletions
|
@ -10,6 +10,7 @@
|
|||
(ns app.main
|
||||
(:require
|
||||
[app.common.uuid :as uuid]
|
||||
[app.common.spec :as us]
|
||||
[app.main.data.auth :refer [logout]]
|
||||
[app.main.data.users :as udu]
|
||||
[app.main.store :as st]
|
||||
|
@ -35,12 +36,26 @@
|
|||
|
||||
(declare reinit)
|
||||
|
||||
(s/def ::any any?)
|
||||
|
||||
(defn match-path
|
||||
[router path]
|
||||
(when-let [match (rt/match router path)]
|
||||
(if-let [conform (get-in match [:data :conform])]
|
||||
(let [spath (get conform :path-params ::any)
|
||||
squery (get conform :query-params ::any)]
|
||||
(-> (dissoc match :params)
|
||||
(assoc :path-params (us/conform spath (get match :path-params))
|
||||
:query-params (us/conform squery (get match :query-params)))))
|
||||
match)))
|
||||
|
||||
(defn on-navigate
|
||||
[router path]
|
||||
(let [match (rt/match router path)
|
||||
(let [match (match-path router path)
|
||||
profile (:profile storage)
|
||||
authed? (and (not (nil? profile))
|
||||
(not= (:id profile) uuid/zero))]
|
||||
|
||||
(cond
|
||||
(and (or (= path "")
|
||||
(nil? match))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue