Files
status-react/env/dev/env/utils.cljs
T
Vitaliy Vlasov 88740eaf52 Add remove-chat button next to chat title
Update chat header design

Aligh header heights

Add 'Clear history'; some reformatting

Add confirmations

Formatting

Member photo fix; increase font size for 9+ unviewed messages indicator

Fix chat view autoloading upon tab switching; Merge with desktop

Fix add-to-contacts
2018-08-20 13:42:07 +03:00

22 lines
555 B
Clojure

(ns env.utils
(:require [clojure.string :as string]))
(defn get-host
"Expects the input url to be in the form protocol://host:port
Returns host or an empty string upon failure"
[url]
(->
url
(string/split #"/")
(get 2 "")
(string/split #":")
(get 0 "")))
(defn re-frisk-url
"Expects the input url to be in the form ws://host:port/figwheel-ws"
[url]
(let [host (get-host url)]
(if (string/blank? host)
(throw (js/Error. "Failed to parse figwheel url. re-frisk url cannot be blank"))
(str host ":" 4567))))