Skip to content
Snippets Groups Projects
Unverified Commit 383c8bed authored by Noah Moss's avatar Noah Moss Committed by GitHub
Browse files

don't try to update recent views if no user-id is passed (#31103)

parent a3cdc40e
No related branches found
No related tags found
No related merge requests found
......@@ -135,14 +135,15 @@
(defn- update-users-recent-views!
[user-id model model-id]
(mw.session/with-current-user user-id
(let [view {:model (name model)
:model_id model-id}
prior-views (remove #{view} (user-recent-views))]
(when (= model "dashboard") (most-recently-viewed-dashboard! model-id))
(when-not ((set prior-views) view)
(let [new-views (vec (take 10 (conj prior-views view)))]
(user-recent-views! new-views))))))
(when user-id
(mw.session/with-current-user user-id
(let [view {:model (name model)
:model_id model-id}
prior-views (remove #{view} (user-recent-views))]
(when (= model "dashboard") (most-recently-viewed-dashboard! model-id))
(when-not ((set prior-views) view)
(let [new-views (vec (take 10 (conj prior-views view)))]
(user-recent-views! new-views)))))))
(defn handle-view-event!
"Handle processing for a single event notification received on the view-log-channel"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment