From d56b7584909bfcdc3c2068f8f744e030221a1ad0 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sun, 21 Feb 2021 11:02:48 +0100 Subject: [PATCH] :bug: Fix possible bug with share-link formating. --- frontend/src/app/main/ui/viewer/header.cljs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/main/ui/viewer/header.cljs b/frontend/src/app/main/ui/viewer/header.cljs index c97025f13..bb87dce0c 100644 --- a/frontend/src/app/main/ui/viewer/header.cljs +++ b/frontend/src/app/main/ui/viewer/header.cljs @@ -11,6 +11,7 @@ (:require [app.common.math :as mth] [app.common.uuid :as uuid] + [app.config :as cfg] [app.main.data.comments :as dcm] [app.main.data.messages :as dm] [app.main.data.viewer :as dv] @@ -64,9 +65,13 @@ create (st/emitf (dv/create-share-link)) delete (st/emitf (dv/delete-share-link)) - href (.-href js/location) - href (subs href 0 (str/index-of href "?")) - link (str href "?token=" token "&index=0") + router (mf/deref refs/router) + route (mf/deref refs/route) + link (rt/resolve router + :viewer + (:path-params route) + {:token token :index "0"}) + link (str cfg/public-uri "/#" link) copy-link (fn [event]