mirror of
https://github.com/penpot/penpot.git
synced 2026-08-29 16:18:48 +00:00
✨ Add airgapped check to nitrate (#11421)
This commit is contained in:
parent
f06d1df5be
commit
10e40e62a2
@ -43,15 +43,25 @@
|
||||
(swap! storage/storage dissoc
|
||||
nitrate-entry-pending-popup-key)))
|
||||
|
||||
(def ^:private offline-connectivity
|
||||
{:licenses false})
|
||||
|
||||
(defn- air-gapped?
|
||||
[]
|
||||
(contains? cf/flags :air-gapped-conf))
|
||||
|
||||
(defn show-nitrate-popup
|
||||
([popup-type] (show-nitrate-popup popup-type {}))
|
||||
([popup-type extra-props]
|
||||
(ptk/reify ::show-nitrate-popup
|
||||
ptk/WatchEvent
|
||||
(watch [_ _ _]
|
||||
(->> (rp/cmd! ::get-nitrate-connectivity {})
|
||||
(rx/map (fn [connectivity]
|
||||
(modal/show popup-type (merge (or connectivity {}) extra-props)))))))))
|
||||
(if (air-gapped?)
|
||||
(rx/of (modal/show popup-type (merge offline-connectivity extra-props)))
|
||||
(->> (rp/cmd! ::get-nitrate-connectivity {})
|
||||
(rx/map (fn [connectivity]
|
||||
(modal/show popup-type
|
||||
(merge (or connectivity {}) extra-props))))))))))
|
||||
|
||||
(defn build-admin-console-url
|
||||
([path]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user