Merge branch 'feature/flush-timeline-with-holes' into 'develop'
Clear timeline when there's holes between old and new Closes #54 See merge request pleroma/pleroma-fe!171
This commit is contained in:
commit
2431d35277
5 changed files with 48 additions and 13 deletions
|
@ -29,6 +29,13 @@ const Timeline = {
|
|||
},
|
||||
newStatusCount () {
|
||||
return this.timeline.newStatusCount
|
||||
},
|
||||
newStatusCountStr () {
|
||||
if (this.timeline.flushMarker !== 0) {
|
||||
return ''
|
||||
} else {
|
||||
return ` (${this.newStatusCount})`
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
@ -64,8 +71,14 @@ const Timeline = {
|
|||
},
|
||||
methods: {
|
||||
showNewStatuses () {
|
||||
this.$store.commit('showNewStatuses', { timeline: this.timelineName })
|
||||
this.paused = false
|
||||
if (this.timeline.flushMarker !== 0) {
|
||||
this.$store.commit('clearTimeline', { timeline: this.timelineName })
|
||||
this.$store.commit('queueFlush', { timeline: this.timelineName, id: 0 })
|
||||
this.fetchOlderStatuses()
|
||||
} else {
|
||||
this.$store.commit('showNewStatuses', { timeline: this.timelineName })
|
||||
this.paused = false
|
||||
}
|
||||
},
|
||||
fetchOlderStatuses () {
|
||||
const store = this.$store
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{{title}}
|
||||
</div>
|
||||
<button @click.prevent="showNewStatuses" class="base05 base02-background loadmore-button" v-if="timeline.newStatusCount > 0 && !timelineError">
|
||||
{{$t('timeline.show_new')}} ({{timeline.newStatusCount}})
|
||||
{{$t('timeline.show_new')}}{{newStatusCountStr}}
|
||||
</button>
|
||||
<div @click.prevent class="base06 error loadmore-text" v-if="timelineError">
|
||||
{{$t('timeline.error_fetching')}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue