mirror of
https://github.com/penpot/penpot.git
synced 2025-07-25 20:49:44 +02:00
🐛 Fix worker uri handling on release builds.
This commit is contained in:
parent
a4c7215fa8
commit
006bacfef0
6 changed files with 21 additions and 38 deletions
|
@ -12,11 +12,13 @@
|
|||
|
||||
(this-as global
|
||||
(let [config (obj/get global "uxboxConfig")
|
||||
puri (obj/get config "publicURI" "http://localhost:3449/")
|
||||
puri (obj/get config "publicURI")
|
||||
wuri (obj/get config "workerURI")
|
||||
gcid (obj/get config "googleClientID" true)
|
||||
warn (obj/get config "demoWarning" true)]
|
||||
(def default-language "en")
|
||||
(def demo-warning warn)
|
||||
(def google-client-id gcid)
|
||||
(def worker-uri wuri)
|
||||
(def public-uri puri)
|
||||
(def default-theme "default")))
|
||||
|
|
|
@ -12,9 +12,7 @@
|
|||
[cljs.spec.alpha :as s]
|
||||
[uxbox.config :as cfg]
|
||||
[uxbox.common.spec :as us]
|
||||
[uxbox.util.worker :as uw])
|
||||
(:import
|
||||
goog.Uri))
|
||||
[uxbox.util.worker :as uw]))
|
||||
|
||||
(defn on-error
|
||||
[instance error]
|
||||
|
@ -22,10 +20,7 @@
|
|||
|
||||
(defonce instance
|
||||
(when (not= *target* "nodejs")
|
||||
(let [uri (Uri. cfg/public-uri)]
|
||||
(.setPath uri "/js/worker.js")
|
||||
(.setParameterValue uri "publicURI" cfg/public-uri)
|
||||
(uw/init (.toString uri) on-error))))
|
||||
(uw/init cfg/worker-uri on-error)))
|
||||
|
||||
(defn ask!
|
||||
[message]
|
||||
|
|
|
@ -25,14 +25,6 @@
|
|||
[uxbox.util.worker :as w])
|
||||
(:import goog.Uri))
|
||||
|
||||
;; --- Initialization
|
||||
|
||||
(this-as global
|
||||
(let [location (obj/get global "location")
|
||||
uri (Uri. (obj/get location "href"))
|
||||
puri (.getParameterValue uri "publicURI")]
|
||||
(swap! impl/config assoc :public-uri puri)))
|
||||
|
||||
;; --- Messages Handling
|
||||
|
||||
(s/def ::cmd keyword?)
|
||||
|
|
|
@ -11,10 +11,6 @@
|
|||
|
||||
(enable-console-print!)
|
||||
|
||||
;; --- Config
|
||||
|
||||
(defonce config (l/atom {}))
|
||||
|
||||
;; --- Handler
|
||||
|
||||
(defmulti handler :cmd)
|
||||
|
|
|
@ -33,8 +33,7 @@
|
|||
|
||||
(defn- request-page
|
||||
[id]
|
||||
(let [uri (get @impl/config :public-uri "http://localhost:3449/")
|
||||
uri (str uri "/api/w/query/page")]
|
||||
(let [uri "/api/w/query/page"]
|
||||
(p/create
|
||||
(fn [resolve reject]
|
||||
(->> (http/send! {:uri uri
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue