From c61ce1892f1e74c3fbe74330a6cdda8763d99416 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Mon, 18 Mar 2019 09:39:59 +0200 Subject: [PATCH] Fix error during cljs compilation with prod profile --- src/status_im/utils/core.cljc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/status_im/utils/core.cljc b/src/status_im/utils/core.cljc index 518b6d3541..12d98a1e70 100644 --- a/src/status_im/utils/core.cljc +++ b/src/status_im/utils/core.cljc @@ -1,6 +1,7 @@ (ns status-im.utils.core (:require [clojure.string :as str] - [cljs.tools.reader.edn :as edn] + #?(:cljs [cljs.tools.reader.edn :as edn] + :clj [clojure.tools.reader.edn :as edn]) [taoensso.timbre :as log])) (defn truncate-str @@ -66,8 +67,9 @@ [key coll] (into {} (map #(vector (key %) %) coll))) -(defn safe-read-message-content [content] - (try - (edn/read-string content) - (catch :default e - (log/warn "failed to transform message with " e)))) +#?(:cljs + (defn safe-read-message-content [content] + (try + (edn/read-string content) + (catch :default e + (log/warn "failed to transform message with " e)))))