Add airgapped check to nitrate (#11421)

This commit is contained in:
Pablo Alba 2026-08-28 13:58:18 +02:00 committed by GitHub
parent f06d1df5be
commit 10e40e62a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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]