Skip to content

Commit

Permalink
Merge pull request athensresearch#2339 from sid597/inbox-as-property
Browse files Browse the repository at this point in the history
inbox as property on userpage
  • Loading branch information
tangjeff0 authored Sep 6, 2022
2 parents b040c1a + 10e198b commit 7c24c30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/cljs/athens/views/notifications/actions.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

(defn is-block-inbox?
[properties]
(= "[[athens/inbox]]"
(= "athens/inbox"
(:block/string (get properties ":entity/type"))))


Expand Down
14 changes: 5 additions & 9 deletions src/cljs/athens/views/notifications/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,8 @@
(defn get-inbox-uid-for-user
[db at-username]
(let [page-uid (common-db/get-page-uid db at-username)
inbox-document (common-db/get-block-document db [:block/uid page-uid])
inbox-uid (->> inbox-document
:block/children
(filter #(when (= "[[Athens inbox]]" (:block/string %)) %))
first
:block/uid)]
inbox-document (common-db/get-block-property-document db [:block/uid page-uid])
inbox-uid (:block/uid (get inbox-document "athens/inbox"))]
inbox-uid))


Expand All @@ -86,11 +82,11 @@
[[(->> (bfs/internal-representation->atomic-ops
db
[#:block{:uid inbox-uid
:string "[[Athens inbox]]"
:string ""
:properties {":entity/type"
#:block{:string "[[athens/inbox]]"
#:block{:string "athens/inbox"
:uid (common.utils/gen-block-uid)}}}]
{:relation :first
{:relation {:page/title "athens/inbox"}
:page/title at-username})
(composite/make-consequence-op {:op/type :new-inbox}))]
inbox-uid]))
Expand Down

0 comments on commit 7c24c30

Please sign in to comment.