Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85629504
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/components/avatar_list/avatar_list.vue b/src/components/avatar_list/avatar_list.vue
index fd6d833653..5df62ce57f 100644
--- a/src/components/avatar_list/avatar_list.vue
+++ b/src/components/avatar_list/avatar_list.vue
@@ -1,55 +1,34 @@
<template>
- <ul class="avatars" :class="{ 'transparent-avatar': slicedAvatars.length == 15 }">
- <li class="avatars-item" v-for="avatar in slicedAvatars" :key="avatar.id">
+ <ul class="avatars">
+ <li class="avatars-item" v-for="(avatar, index) in slicedAvatars" :key="`avatar-${index}`">
<UserAvatar :src="avatar.profile_image_url" class="avatars-img" />
</li>
</ul>
</template>
<script src="./avatar_list.js" ></script>
<style lang="scss">
@import '../../_variables.scss';
.avatars {
display: inline-flex; /* Causes LI items to display in row. */
list-style-type: none;
margin: 0;
padding: 0px 15px 0px 0px;
flex-direction: row-reverse;
&-item {
- height: 30px;
+ height: 25px;
margin: 0;
padding: 0;
width: 15px;
.avatars-img {
- border-radius: 50%;
- height: 30px;
- width: 30px;
- line-height: 30px;
- background-color: $main-background;
- }
- }
-}
-
-.transparent-avatar {
- .avatars-item {
- &:first-child {
- position: relative;
-
- .avatars-img {
- &::after {
- content: '';
- position: absolute;
- width: 100%;
- height: 100%;
- background-color: rgba(255, 255, 255, 0.7);
- left: 0;
- top: 0;
- }
- }
+ border-radius: $fallback--avatarAltRadius;
+ border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
+ height: 25px !important;
+ width: 25px !important;
}
}
}
</style>
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index ba90746ea6..115ac6408a 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -1,164 +1,158 @@
import { reduce, filter, findIndex, clone } from 'lodash'
import Status from '../status/status.vue'
const sortById = (a, b) => {
const idA = a.type === 'retweet' ? a.retweeted_status.id : a.id
const idB = b.type === 'retweet' ? b.retweeted_status.id : b.id
const seqA = Number(idA)
const seqB = Number(idB)
const isSeqA = !Number.isNaN(seqA)
const isSeqB = !Number.isNaN(seqB)
if (isSeqA && isSeqB) {
return seqA < seqB ? -1 : 1
} else if (isSeqA && !isSeqB) {
return -1
} else if (!isSeqA && isSeqB) {
return 1
} else {
return idA < idB ? -1 : 1
}
}
const sortAndFilterConversation = (conversation, statusoid) => {
if (statusoid.type === 'retweet') {
conversation = filter(
conversation,
(status) => (status.type === 'retweet' || status.id !== statusoid.retweeted_status.id)
)
} else {
conversation = filter(conversation, (status) => status.type !== 'retweet')
}
return conversation.filter(_ => _).sort(sortById)
}
const conversation = {
data () {
return {
highlight: null,
expanded: false
}
},
props: [
'statusoid',
'collapsable',
'isPage'
],
created () {
if (this.isPage) {
this.fetchConversation()
}
},
computed: {
status () {
return this.statusoid
},
statusId () {
if (this.statusoid.retweeted_status) {
return this.statusoid.retweeted_status.id
} else {
return this.statusoid.id
}
},
conversationId () {
if (this.statusoid.retweeted_status) {
return this.statusoid.retweeted_status.statusnet_conversation_id
} else {
return this.statusoid.statusnet_conversation_id
}
},
conversation () {
if (!this.status) {
return []
}
if (!this.isExpanded) {
return [this.status]
}
const conversation = clone(this.$store.state.statuses.conversationsObject[this.conversationId])
const statusIndex = findIndex(conversation, { id: this.statusId })
if (statusIndex !== -1) {
conversation[statusIndex] = this.status
}
return sortAndFilterConversation(conversation, this.status)
},
replies () {
let i = 1
return reduce(this.conversation, (result, {id, in_reply_to_status_id}) => {
/* eslint-disable camelcase */
const irid = in_reply_to_status_id
/* eslint-enable camelcase */
if (irid) {
result[irid] = result[irid] || []
result[irid].push({
name: `#${i}`,
id: id
})
}
i++
return result
}, {})
},
isExpanded () {
return this.expanded || this.isPage
}
},
components: {
Status
},
watch: {
'$route': 'fetchConversation',
expanded (value) {
if (value) {
this.fetchConversation()
}
}
},
methods: {
fetchConversation () {
if (this.status) {
this.$store.state.api.backendInteractor.fetchConversation({id: this.status.id})
.then(({ancestors, descendants}) => {
const ancestorId = ancestors.length ? ancestors[0].id : this.status.id
- this.fetchFavoritedByUsers(ancestorId)
- this.fetchRebloggedByUsers(ancestorId)
+ this.$store.dispatch('fetchFavoritedByUsers', { id: ancestorId })
+ this.$store.dispatch('fetchRebloggedByUsers', { id: ancestorId })
this.$store.dispatch('addNewStatuses', { statuses: ancestors })
this.$store.dispatch('addNewStatuses', { statuses: descendants })
})
.then(() => this.setHighlight(this.statusId))
} else {
const id = this.$route.params.id
this.$store.state.api.backendInteractor.fetchStatus({id})
.then((status) => this.$store.dispatch('addNewStatuses', { statuses: [status] }))
.then(() => this.fetchConversation())
}
},
getReplies (id) {
return this.replies[id] || []
},
focused (id) {
return (this.isExpanded) && id === this.status.id
},
setHighlight (id) {
this.highlight = id
},
getHighlight () {
return this.isExpanded ? this.highlight : null
},
toggleExpanded () {
this.expanded = !this.expanded
if (!this.expanded) {
this.setHighlight(null)
}
- },
- fetchFavoritedByUsers (id) {
- this.$store.dispatch('fetchFavoritedByUsers', { id })
- },
- fetchRebloggedByUsers (id) {
- this.$store.dispatch('fetchRebloggedByUsers', { id })
}
}
}
export default conversation
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Aug 8, 10:39 PM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1724021
Default Alt Text
(6 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment