🐛 Fix profile images on workspace.

This commit is contained in:
Andrey Antukh 2021-01-20 22:14:56 +01:00
parent 11418501a4
commit f0b9837407
2 changed files with 16 additions and 10 deletions

View file

@ -158,18 +158,18 @@
;; implemented in UI)
(def sql:team-users
"select pf.id, pf.fullname, pf.photo
"select pf.id, pf.fullname, pf.photo_id
from profile as pf
inner join team_profile_rel as tpr on (tpr.profile_id = pf.id)
where tpr.team_id = ?
union
select pf.id, pf.fullname, pf.photo
select pf.id, pf.fullname, pf.photo_id
from profile as pf
inner join project_profile_rel as ppr on (ppr.profile_id = pf.id)
inner join project as p on (ppr.project_id = p.id)
where p.team_id = ?
union
select pf.id, pf.fullname, pf.photo
select pf.id, pf.fullname, pf.photo_id
from profile as pf
inner join file_profile_rel as fpr on (fpr.profile_id = pf.id)
inner join file as f on (fpr.file_id = f.id)

View file

@ -58,13 +58,19 @@
stoper (rx/filter #(= ::finalize %) stream)
interval (* 1000 60)]
(->> (rx/merge
;; Each 60 seconds send a keepalive message for maintain
;; this socket open.
(->> (rx/timer interval interval)
(rx/map #(send-keepalive file-id)))
;; Process all incoming messages.
(->> (ws/-stream wsession)
(rx/filter ws/message?)
(rx/map (comp t/decode :payload))
(rx/filter #(s/valid? ::message %))
(rx/map process-message))
;; Send back to backend all pointer messages.
(->> stream
(rx/filter ms/pointer-event?)
(rx/sample 50)
@ -130,7 +136,7 @@
})
(defn handle-presence
[{:keys [sessions] :as msg}]
[{:keys [sessions] :as message}]
(letfn [(assign-color [sessions session]
(if (string? (:color session))
session