forked from AkkomaGang/akkoma-fe
update prop name
This commit is contained in:
parent
482cd52f77
commit
9727009147
3 changed files with 15 additions and 15 deletions
|
@ -2,7 +2,7 @@
|
||||||
<conversation
|
<conversation
|
||||||
:collapsable="false"
|
:collapsable="false"
|
||||||
is-page="true"
|
is-page="true"
|
||||||
:statusoid="statusId"
|
:status-id="statusId"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ const conversation = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
'statusoid',
|
'statusId',
|
||||||
'collapsable',
|
'collapsable',
|
||||||
'isPage',
|
'isPage',
|
||||||
'pinnedStatusIdsObject'
|
'pinnedStatusIdsObject'
|
||||||
|
@ -51,17 +51,17 @@ const conversation = {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
status () {
|
status () {
|
||||||
return this.$store.state.statuses.allStatusesObject[this.statusoid]
|
return this.$store.state.statuses.allStatusesObject[this.statusId]
|
||||||
},
|
},
|
||||||
statusId () {
|
originalStatusId () {
|
||||||
if (this.status.retweeted_status) {
|
if (this.status.retweeted_status) {
|
||||||
return this.status.retweeted_status.id
|
return this.status.retweeted_status.id
|
||||||
} else {
|
} else {
|
||||||
return this.statusoid
|
return this.statusId
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
conversationId () {
|
conversationId () {
|
||||||
return this.getConversationId(this.statusoid)
|
return this.getConversationId(this.statusId)
|
||||||
},
|
},
|
||||||
conversation () {
|
conversation () {
|
||||||
if (!this.status) {
|
if (!this.status) {
|
||||||
|
@ -73,7 +73,7 @@ const conversation = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const conversation = clone(this.$store.state.statuses.conversationsObject[this.conversationId])
|
const conversation = clone(this.$store.state.statuses.conversationsObject[this.conversationId])
|
||||||
const statusIndex = findIndex(conversation, { id: this.statusId })
|
const statusIndex = findIndex(conversation, { id: this.originalStatusId })
|
||||||
if (statusIndex !== -1) {
|
if (statusIndex !== -1) {
|
||||||
conversation[statusIndex] = this.status
|
conversation[statusIndex] = this.status
|
||||||
}
|
}
|
||||||
|
@ -106,11 +106,11 @@ const conversation = {
|
||||||
Status
|
Status
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
statusoid (newVal, oldVal) {
|
statusId (newVal, oldVal) {
|
||||||
const newConversationId = this.getConversationId(newVal)
|
const newConversationId = this.getConversationId(newVal)
|
||||||
const oldConversationId = this.getConversationId(oldVal)
|
const oldConversationId = this.getConversationId(oldVal)
|
||||||
if (newConversationId && oldConversationId && newConversationId === oldConversationId) {
|
if (newConversationId && oldConversationId && newConversationId === oldConversationId) {
|
||||||
this.setHighlight(this.statusId)
|
this.setHighlight(this.originalStatusId)
|
||||||
} else {
|
} else {
|
||||||
this.fetchConversation()
|
this.fetchConversation()
|
||||||
}
|
}
|
||||||
|
@ -124,14 +124,14 @@ const conversation = {
|
||||||
methods: {
|
methods: {
|
||||||
fetchConversation () {
|
fetchConversation () {
|
||||||
if (this.status) {
|
if (this.status) {
|
||||||
this.$store.state.api.backendInteractor.fetchConversation({ id: this.statusoid })
|
this.$store.state.api.backendInteractor.fetchConversation({ id: this.statusId })
|
||||||
.then(({ ancestors, descendants }) => {
|
.then(({ ancestors, descendants }) => {
|
||||||
this.$store.dispatch('addNewStatuses', { statuses: ancestors })
|
this.$store.dispatch('addNewStatuses', { statuses: ancestors })
|
||||||
this.$store.dispatch('addNewStatuses', { statuses: descendants })
|
this.$store.dispatch('addNewStatuses', { statuses: descendants })
|
||||||
this.setHighlight(this.statusId)
|
this.setHighlight(this.originalStatusId)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$store.state.api.backendInteractor.fetchStatus({ id: this.statusoid })
|
this.$store.state.api.backendInteractor.fetchStatus({ id: this.statusId })
|
||||||
.then((status) => {
|
.then((status) => {
|
||||||
this.$store.dispatch('addNewStatuses', { statuses: [status] })
|
this.$store.dispatch('addNewStatuses', { statuses: [status] })
|
||||||
this.fetchConversation()
|
this.fetchConversation()
|
||||||
|
@ -142,7 +142,7 @@ const conversation = {
|
||||||
return this.replies[id] || []
|
return this.replies[id] || []
|
||||||
},
|
},
|
||||||
focused (id) {
|
focused (id) {
|
||||||
return (this.isExpanded) && id === this.statusoid
|
return (this.isExpanded) && id === this.statusId
|
||||||
},
|
},
|
||||||
setHighlight (id) {
|
setHighlight (id) {
|
||||||
if (!id) return
|
if (!id) return
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
v-if="timeline.statusesObject[statusId]"
|
v-if="timeline.statusesObject[statusId]"
|
||||||
:key="statusId + '-pinned'"
|
:key="statusId + '-pinned'"
|
||||||
class="status-fadein"
|
class="status-fadein"
|
||||||
:statusoid="statusId"
|
:status-id="statusId"
|
||||||
:collapsable="true"
|
:collapsable="true"
|
||||||
:pinned-status-ids-object="pinnedStatusIdsObject"
|
:pinned-status-ids-object="pinnedStatusIdsObject"
|
||||||
/>
|
/>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
v-if="!excludedStatusIdsObject[status.id]"
|
v-if="!excludedStatusIdsObject[status.id]"
|
||||||
:key="status.id"
|
:key="status.id"
|
||||||
class="status-fadein"
|
class="status-fadein"
|
||||||
:statusoid="status.id"
|
:status-id="status.id"
|
||||||
:collapsable="true"
|
:collapsable="true"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in a new issue