<commit_before>(ns wombats-web-client.routes
    (:require-macros [secretary.core :refer [defroute]])
    (:import goog.History)
    (:require [secretary.core :as secretary]
              [goog.events :as events]
              [goog.history.EventType :as EventType]
              [pushy.core :as pushy]
              [re-frame.core :as re-frame]
              [wombats-web-client.events.user :refer [sign-out-event]]
              [wombats-web-client.utils.auth :refer [user-is-coordinator?]]))

(defn hook-browser-navigation! []
  (doto (History.)
    (events/listen
     EventType/NAVIGATE
     (fn [event]
       (secretary/dispatch! (.-token event))))
    (.setEnabled true)))

(defn app-routes []
  ;; --------------------
  ;; define routes here

  (defroute "/" []
    (re-frame/dispatch [:set-active-panel :view-games-panel]))

  (defroute "/games/:game-id" {game-id :game-id}
    (re-frame/dispatch [:game/join-game game-id])
    (re-frame/dispatch [:set-active-panel :game-play-panel]))

  (defroute "/config" []
    (if (user-is-coordinator?)
      (re-frame/dispatch [:set-active-panel :config-panel])
      (re-frame/dispatch [:set-active-panel :page-not-found-panel])))

  (defroute "/simulator" []
    (re-frame/dispatch [:set-active-panel :simulator-panel]))

  (defroute "/account" []
    (re-frame/dispatch [:set-active-panel :account-panel]))

  (def history (pushy/pushy secretary/dispatch!
                            (fn [x] (when (secretary/locate-route x) x))))

  ;; --------------------
  (pushy/start! history)
  (hook-browser-navigation!))<commit_msg>Fixed problem with loading a route.<commit_after>(ns wombats-web-client.routes
    (:require-macros [secretary.core :refer [defroute]])
    (:import goog.History)
    (:require [secretary.core :as secretary]
              [goog.events :as events]
              [goog.history.EventType :as EventType]
              [pushy.core :as pushy]
              [re-frame.core :as re-frame]
              [wombats-web-client.events.user :refer [sign-out-event]]
              [wombats-web-client.utils.auth :refer [user-is-coordinator?]]))

(defonce history (pushy/pushy secretary/dispatch!
                              (fn [x] 
                                (when (secretary/locate-route x) x))))

(defn app-routes []
  ;; define routes here

  (defroute "/" []
    (re-frame/dispatch [:set-active-panel :view-games-panel]))

  (defroute "/games/:game-id" {game-id :game-id}
    (re-frame/dispatch [:game/join-game game-id])
    (re-frame/dispatch [:set-active-panel :game-play-panel]))

  (defroute "/config" []
    (if (user-is-coordinator?)
      (re-frame/dispatch [:set-active-panel :config-panel])
      (re-frame/dispatch [:set-active-panel :page-not-found-panel])))

  (defroute "/simulator" []
    (re-frame/dispatch [:set-active-panel :simulator-panel]))

  (defroute "/account" []
    (re-frame/dispatch [:set-active-panel :account-panel]))

  (pushy/start! history))
{'fraction_non_alphanumeric': 0.18135593220338983, 'fraction_numerical': 0.0, 'mean_word_length': 2.471764705882353, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3818448', 'n_tokens_mistral': 1008, 'n_tokens_neox': 993, 'n_words': 180}