Realm posts mixed in feed

💩 The feed api didn't respect the visibility level
This commit is contained in:
2024-03-25 19:40:43 +08:00
parent fb0c7860e0
commit 562af023f1
6 changed files with 23 additions and 10 deletions

View File

@ -26,6 +26,7 @@ const isOwned = computed(() => props.item?.author_id === id.userinfo.data.id)
function editPost() {
editor.related.edit_to = JSON.parse(JSON.stringify(props.item))
// eslint-disable-next-line
if (editor.show.hasOwnProperty(props.item.model_type)) {
// @ts-ignore
editor.show[props.item.model_type] = true

View File

@ -33,8 +33,11 @@
@update="updateReactions"
/>
<div class="mt-1 text-xs opacity-80 flex gap-2 items-center">
<div class="mt-3 text-xs opacity-80 flex items-center">
<span>Posted at {{ new Date(props.item?.created_at).toLocaleString() }}</span>
<section v-if="props.item?.realm_id">
&nbsp;·&nbsp;<span>In realm #{{ props.item?.realm_id }}</span>
</section>
</div>
</div>
@ -67,6 +70,7 @@ function updateReactions(symbol: string, num: number) {
if (item.reaction_list == null) {
item.reaction_list = {}
}
// eslint-disable-next-line
if (item.reaction_list.hasOwnProperty(symbol)) {
item.reaction_list[symbol] += num
} else {

View File

@ -92,6 +92,7 @@ async function readPost() {
readPost()
function updateReactions(symbol: string, num: number) {
// eslint-disable-next-line
if (post.value.reaction_list.hasOwnProperty(symbol)) {
post.value.reaction_list[symbol] += num
} else {

View File

@ -100,6 +100,7 @@ async function readPost() {
readPost()
function updateReactions(symbol: string, num: number) {
// eslint-disable-next-line
if (post.value.reaction_list.hasOwnProperty(symbol)) {
post.value.reaction_list[symbol] += num
} else {