diff --git a/public/index.html b/public/index.html index 798c377..7f74af7 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,9 @@
result + .-data + js->edn)))) diff --git a/src/main/dda/masto_embed/app.cljs b/src/main/dda/masto_embed/app.cljs index 648abf2..7c1a531 100644 --- a/src/main/dda/masto_embed/app.cljs +++ b/src/main/dda/masto_embed/app.cljs @@ -16,6 +16,8 @@ (ns dda.masto-embed.app (:require [dda.masto-embed.api :as api] + [cljs.core.async :refer [go close! put! take! timeout chan !]] + [cljs.core.async.interop :refer-macros [
js/document (.getElementById masto-embed) (.getAttribute "host_url"))) - (defn account-name-from-document [] + (-> js/document (.getElementById masto-embed) (.getAttribute "account_name"))) @@ -42,8 +44,40 @@ (.-innerHTML) (set! input))) +(defn debug [elem] + (print elem) + elem) + + +(defn find-account-id [host-url account-name] + (let [in (chan) + out (chan)] + (go + (->> + (! out)) + (do (close! in) + (close! out)) + ) + ;(api/get-directory host-url #(go (>! in %))) + out)) + (defn init [] - (api/get-account-statuses - (host-url-from-document) - (account-id-from-document) - render-to-document)) \ No newline at end of file + (go + (let [account-id (or + (account-id-from-document) + (