Skip to content

Commit

Permalink
fix lobby list not filtering right on manual request
Browse files Browse the repository at this point in the history
  • Loading branch information
NBKelly committed Oct 5, 2024
1 parent b01e061 commit f2a865f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/clj/web/lobby.clj
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,12 @@
(summaries-for-lobbies)))

(defn prepare-lobby-list
[in-order-lobbies users]
(for [user users
:let [uid (:uid user)]]
(let [filtered-lobbies (into [] (filter-lobby-list in-order-lobbies user))]
[uid [:lobby/list filtered-lobbies]])))
[lobbies users]
(let [in-order-lobbies (sorted-lobbies lobbies)]
(for [user users
:let [uid (:uid user)]]
(let [filtered-lobbies (into [] (filter-lobby-list in-order-lobbies user))]
[uid [:lobby/list filtered-lobbies]]))))

(defn lobby-update-uids
[]
Expand All @@ -266,9 +267,8 @@
(broadcast-lobby-list users)))
([users]
(assert (or (sequential? users) (nil? users)) (str "Users must be a sequence: " (pr-str users)))
(let [lobbies (app-state/get-lobbies)
in-order (sorted-lobbies lobbies)]
(doseq [[uid ev] (prepare-lobby-list in-order users)]
(let [lobbies (app-state/get-lobbies)]
(doseq [[uid ev] (prepare-lobby-list lobbies users)]
(when uid
(ws/chsk-send! uid ev))))))

Expand Down

0 comments on commit f2a865f

Please sign in to comment.