Add support for optional human challenge

This commit is contained in:
Andrey Antukh 2024-09-05 15:28:24 +02:00 committed by Alejandro Alonso
parent b2010e5fd8
commit 3f34aa92fa
5 changed files with 62 additions and 2 deletions

View file

@ -13,8 +13,10 @@
[app.main.data.events :as ev]
[app.util.browser-history :as bhistory]
[app.util.dom :as dom]
[app.util.globals :as globals]
[app.util.timers :as ts]
[beicon.v2.core :as rx]
[cuerdas.core :as str]
[goog.events :as e]
[potok.v2.core :as ptk]
[reitit.core :as r]))
@ -143,6 +145,20 @@
(= (.-hostname location) (:host referrer)))
(nav-back))))
(defn nav-raw
[href]
(ptk/reify ::nav-raw
ptk/EffectEvent
(effect [_ _ _]
(set! (.-href globals/location) href))))
(defn get-current-path
[]
(let [hash (.-hash globals/location)]
(if (str/starts-with? hash "#")
(subs hash 1)
hash)))
;; --- History API
(defn initialize-history