minor fix and renames
This commit is contained in:
parent
f8ef76811e
commit
3e59c61baf
3 changed files with 18 additions and 12 deletions
|
|
@ -136,7 +136,7 @@ const Status = {
|
||||||
status() {
|
status() {
|
||||||
return this.statusoid ?? useStatusesStore().allStatuses.get(this.statusId)
|
return this.statusoid ?? useStatusesStore().allStatuses.get(this.statusId)
|
||||||
},
|
},
|
||||||
retweetedStatus() {
|
repeatedStatus() {
|
||||||
return useStatusesStore().allStatuses.get(this.status.retweeted_status.id)
|
return useStatusesStore().allStatuses.get(this.status.retweeted_status.id)
|
||||||
},
|
},
|
||||||
repeater() {
|
repeater() {
|
||||||
|
|
@ -167,7 +167,7 @@ const Status = {
|
||||||
userClass() {
|
userClass() {
|
||||||
return highlightClass(this.user)
|
return highlightClass(this.user)
|
||||||
},
|
},
|
||||||
deleted() {
|
isDeleted() {
|
||||||
return this.status.deleted
|
return this.status.deleted
|
||||||
},
|
},
|
||||||
repeaterStyle() {
|
repeaterStyle() {
|
||||||
|
|
@ -187,11 +187,13 @@ const Status = {
|
||||||
const user = useUsersStore().findUser(
|
const user = useUsersStore().findUser(
|
||||||
this.mainStatus.in_reply_to_user_id,
|
this.mainStatus.in_reply_to_user_id,
|
||||||
)
|
)
|
||||||
// FIXME Why user not found sometimes???
|
|
||||||
return user ? user.statusnet_profile_url : 'NOT_FOUND'
|
// User referenced in post might not be yet present in store
|
||||||
|
// since their data is not included in status data
|
||||||
|
return user?.statusnet_profile_url
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
retweet() {
|
isRepeat() {
|
||||||
return !!this.status.retweeted_status
|
return !!this.status.retweeted_status
|
||||||
},
|
},
|
||||||
repeaterName() {
|
repeaterName() {
|
||||||
|
|
@ -207,8 +209,8 @@ const Status = {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
mainStatus() {
|
mainStatus() {
|
||||||
if (this.retweet) {
|
if (this.isRepeat) {
|
||||||
return this.retweetedStatus
|
return this.repeatedStatus
|
||||||
} else {
|
} else {
|
||||||
return this.status
|
return this.status
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<div class="status-container muted">
|
<div class="status-container muted">
|
||||||
<small class="status-username">
|
<small class="status-username">
|
||||||
<FAIcon
|
<FAIcon
|
||||||
v-if="muted && retweet"
|
v-if="muted && isRepeat"
|
||||||
class="fa-scale-110 fa-old-padding repeat-icon"
|
class="fa-scale-110 fa-old-padding repeat-icon"
|
||||||
icon="retweet"
|
icon="retweet"
|
||||||
/>
|
/>
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div
|
<div
|
||||||
v-if="retweet && !noHeading && !inConversation"
|
v-if="isRepeat && !noHeading && !inConversation"
|
||||||
:class="[repeaterClass, { highlighted: repeaterStyle }]"
|
:class="[repeaterClass, { highlighted: repeaterStyle }]"
|
||||||
:style="[repeaterStyle]"
|
:style="[repeaterStyle]"
|
||||||
class="status-container repeat-info"
|
class="status-container repeat-info"
|
||||||
|
|
@ -91,8 +91,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="!deleted"
|
v-if="!isDeleted"
|
||||||
:class="[userClass, { highlighted: userStyle, '-repeat': retweet && !inConversation }]"
|
:class="[userClass, { highlighted: userStyle, '-repeat': isRepeat && !inConversation }]"
|
||||||
:style="[ userStyle ]"
|
:style="[ userStyle ]"
|
||||||
class="status-container"
|
class="status-container"
|
||||||
:data-tags="tags"
|
:data-tags="tags"
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,6 @@ export const useStatusesStore = defineStore('statuses', {
|
||||||
return addStatus(status)
|
return addStatus(status)
|
||||||
},
|
},
|
||||||
retweet: (status) => {
|
retweet: (status) => {
|
||||||
// RetweetedStatuses are never shown immediately
|
|
||||||
if (status.retweeted_status) addStatus(status.retweeted_status)
|
if (status.retweeted_status) addStatus(status.retweeted_status)
|
||||||
return addStatus(status)
|
return addStatus(status)
|
||||||
},
|
},
|
||||||
|
|
@ -143,6 +142,11 @@ export const useStatusesStore = defineStore('statuses', {
|
||||||
timestamp,
|
timestamp,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { in_reply_to_user_id } = status
|
||||||
|
if (in_reply_to_user_id) {
|
||||||
|
useUsersStore().fetchUserIfMissing({ id: in_reply_to_user_id })
|
||||||
|
}
|
||||||
|
|
||||||
existing.user = user // reactive update in case we return old
|
existing.user = user // reactive update in case we return old
|
||||||
|
|
||||||
// implicit: if oldTimestamp is undefined this will still be false
|
// implicit: if oldTimestamp is undefined this will still be false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue