0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Fix logic

This commit is contained in:
Florian Schroedl 2024-08-22 11:59:06 +02:00
parent 157cc5a994
commit e4f01d1d5e

View file

@ -283,13 +283,11 @@
(when @open?
[:& sets-list {:selected-set-id selected-set-id}])]))
(defn dev-or-preview-url? [url]
(let [host (-> url js/URL. .-host)
pure-host (first (str/split host #":"))
domain (second (str/split pure-host #"\."))]
(or (= domain "penpot.tokens.studio")
(= pure-host "localhost"))))
localhost? (= "localhost" (first (str/split host #":")))
pr? (str/ends-with? host "penpot.alpha.tokens.studio")]
(or localhost? pr?)))
(defn location-url-dev-or-preview-url!? []
(dev-or-preview-url? js/window.location.href))