From fff7fe83a4805343227df11af22cc61deef6bb84 Mon Sep 17 00:00:00 2001 From: NB Kelly Date: Sun, 7 Jul 2024 10:33:29 +1200 Subject: [PATCH] check types match for time comparison --- src/cljs/nr/game_row.cljs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cljs/nr/game_row.cljs b/src/cljs/nr/game_row.cljs index 0cb82a1739..76b75619de 100644 --- a/src/cljs/nr/game_row.cljs +++ b/src/cljs/nr/game_row.cljs @@ -147,8 +147,13 @@ minutes)) (defn game-time [game] -(when (:started game) - [:div.game-time (str (time-since (:date game)) "m")])) + ;; NOTE: while running locally (repl), the :date field ends up being + ;; native code, rather than Instant type. I don't understand this, + ;; but when running via uberjar (or after reloading web/lobby.clj) + ;; it is of the correct type. IDK how to fix the problem, but this + ;; is a workable temporary fix - NBKelly, Jul 2024 + (when (and (:started game) (= (type (:date game)) (type (inst/now)))) + [:div.game-time (str (time-since (:date game)) "m")])) (defn players-row [{players :players :as game}] (into