cleanup in app

This commit is contained in:
bom 2022-03-11 09:50:01 +01:00
parent e678de8f4e
commit 4bde2412fe

View file

@ -105,14 +105,14 @@
(defn replies-mode [host-url account-name post-id filter-favorited] (defn replies-mode [host-url account-name post-id filter-favorited]
(go (go
(let [test-status (-> (let [replies (->
(<p! (api/get-replies host-url post-id)) (<p! (api/get-replies host-url post-id))
api/mastojs->edn) api/mastojs->edn)
favorited (<! (favorited? host-url account-name (map :id (:descendants test-status)))) favorited (<! (favorited? host-url account-name (map :id (:descendants replies))))
combined (map (fn [s f] {:status s :favorited f}) (:descendants test-status) favorited) combined (map (fn [s f] {:status s :favorited f}) (:descendants replies) favorited)]
filtered (map :status (filter :favorited combined)) (->> combined
statuus (if filter-favorited filtered test-status)] (filter #(infra/debug (or (not filter-favorited) (:favorited %))))
(->> statuus (map :status)
(infra/debug) (infra/debug)
(rb/masto->html) (rb/masto->html)
(render-html) (render-html)
@ -122,8 +122,7 @@
(let [host-url (host-url-from-document) (let [host-url (host-url-from-document)
account-name (account-name-from-document) account-name (account-name-from-document)
replies-to (replies-to-from-document) replies-to (replies-to-from-document)
filter-favorited (filter-favorited-from-document) filter-favorited (filter-favorited-from-document)]
]
(if (nil? replies-to) (if (nil? replies-to)
(account-mode host-url account-name) (account-mode host-url account-name)
(replies-mode host-url account-name replies-to filter-favorited)) (replies-mode host-url account-name replies-to filter-favorited))