Split mode functions into raw and rendered
If we want to create different html to the default the raw functions can be used to build html from the reply itself.
This commit is contained in:
parent
f0aa2633a7
commit
a24ee62d16
1 changed files with 18 additions and 10 deletions
|
@ -61,7 +61,7 @@
|
|||
first)))
|
||||
out))
|
||||
|
||||
(defn replies-mode [host-url account-name post-id filter-favorited]
|
||||
(defn replies-mode-raw [host-url account-name post-id filter-favorited]
|
||||
(go
|
||||
(let [replies (->
|
||||
(<p! (api/get-replies host-url post-id))
|
||||
|
@ -71,12 +71,16 @@
|
|||
(->> combined
|
||||
(filter #(or (not filter-favorited) (:favorited %)))
|
||||
(reverse)
|
||||
(map :status)
|
||||
(th/masto->html "replies-mode")
|
||||
(render-html)
|
||||
(b/render-to-document)))))
|
||||
(map :status)))))
|
||||
|
||||
(defn account-mode [host-url account-name]
|
||||
(defn replies-mode [host-url account-name post-id filter-favorited]
|
||||
(go
|
||||
(->> (replies-mode-raw host-url account-name post-id filter-favorited)
|
||||
(th/masto->html "replies-mode")
|
||||
(render-html)
|
||||
(b/render-to-document))))
|
||||
|
||||
(defn account-mode-raw [host-url account-name]
|
||||
(go
|
||||
(let [account-id (<! (find-account-id host-url account-name))
|
||||
status (->
|
||||
|
@ -85,7 +89,11 @@
|
|||
(->> status
|
||||
(filter #(= nil (:reblog %)))
|
||||
(filter #(= nil (:in_reply_to_account_id %)))
|
||||
(take 4)
|
||||
(th/masto->html "account-mode")
|
||||
(render-html)
|
||||
(b/render-to-document)))))
|
||||
(take 4)))))
|
||||
|
||||
(defn account-mode [host-url account-name]
|
||||
(go
|
||||
(->> (account-mode-raw host-url account-name)
|
||||
(th/masto->html "account-mode")
|
||||
(render-html)
|
||||
(b/render-to-document))))
|
||||
|
|
Loading…
Reference in a new issue