0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-04 05:18:56 -05:00
penpot/frontend/src/uxbox/config.cljs

29 lines
869 B
Text
Raw Normal View History

;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; This Source Code Form is "Incompatible With Secondary Licenses", as
;; defined by the Mozilla Public License, v. 2.0.
;;
;; Copyright (c) 2016-2020 Andrey Antukh <niwi@niwi.nz>
(ns uxbox.config
(:require [goog.object :as gobj]))
(defn- get-current-origin
[]
(let [location (gobj/get goog.global "location")]
(gobj/get location "origin")))
(let [config (gobj/get goog.global "uxboxConfig")
backend-url (gobj/get config "backendURL" "http://localhost:6060")]
(def default-language "en")
(def demo-warning (gobj/get config "demoWarning" true))
(def url
(if (= backend-url "samesite")
(get-current-origin)
backend-url)))