🐛 Fixed issue with shared token for logged users

This commit is contained in:
alonso.torres 2020-12-07 08:55:54 +01:00 committed by Alonso Torres
parent 489dc521e3
commit 1b5efa6ba2
4 changed files with 7 additions and 7 deletions

View file

@ -138,7 +138,7 @@
(d/index-by :id)
(assoc state :comment-threads)))
(on-error [err]
(if (= :authorization (:type err))
(if (= :not-authorized (:code err))
(rx/empty)
(rx/throw err)))]
@ -180,7 +180,7 @@
(->> (rp/mutation! :create-file-share-token {:file-id file-id
:page-id page-id})
(rx/map (fn [{:keys [token]}]
#(assoc-in % [:viewer-data :share-token] token))))))))
#(assoc-in % [:viewer-data :token] token))))))))
(defn delete-share-link
[]
@ -189,12 +189,12 @@
(watch [_ state stream]
(let [file-id (:current-file-id state)
page-id (:current-page-id state)
token (get-in state [:viewer-data :share-token])
token (get-in state [:viewer-data :token])
params {:file-id file-id
:page-id page-id
:token token}]
(->> (rp/mutation :delete-file-share-token params)
(rx/map (fn [_] #(update % :viewer-data dissoc :share-token))))))))
(rx/map (fn [_] #(update % :viewer-data dissoc :token))))))))
;; --- Zoom Management

View file

@ -257,7 +257,7 @@
nil)
(when-not anonymous?
[:& share-link {:token (:share-token data)
[:& share-link {:token (:token data)
:page (:page data)}])
(when-not anonymous?