clear up queueFlush nonsense
This commit is contained in:
parent
12df5d09ab
commit
1c1526c065
6 changed files with 14 additions and 15 deletions
|
|
@ -28,7 +28,7 @@ const QuickFilterSettings = {
|
|||
path: 'replyVisibility',
|
||||
value: visibility,
|
||||
})
|
||||
useStatusesStore().queueFlushAll()
|
||||
useStatusesStore().requireReloadAll()
|
||||
},
|
||||
openTab(tab) {
|
||||
useInterfaceStore().openSettingsModalTab(tab)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ const ClutterTab = {
|
|||
// Updating nested properties
|
||||
watch: {
|
||||
replyVisibility() {
|
||||
useStatusesStore().queueFlushAll()
|
||||
useStatusesStore().requireReloadAll()
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ const FilteringTab = {
|
|||
// Updating nested properties
|
||||
watch: {
|
||||
replyVisibility() {
|
||||
useStatusesStore().queueFlushAll()
|
||||
useStatusesStore().requireReloadAll()
|
||||
},
|
||||
muteFiltersObject() {
|
||||
this.muteFiltersDraftObject = cloneDeep(
|
||||
|
|
|
|||
|
|
@ -63,17 +63,17 @@ const Timeline = {
|
|||
return this.timeline.newStatusCount
|
||||
},
|
||||
showLoadButton() {
|
||||
return this.timeline.newStatusCount > 0 || this.timeline.flushMarker !== 0
|
||||
return this.timeline.newStatusCount > 0 || this.timeline.reloadNeeded
|
||||
},
|
||||
loadButtonString() {
|
||||
if (this.timeline.flushMarker !== 0) {
|
||||
if (this.timeline.reloadNeeded) {
|
||||
return this.$t('timeline.reload')
|
||||
} else {
|
||||
return `${this.$t('timeline.show_new')} (${this.newStatusCount})`
|
||||
}
|
||||
},
|
||||
mobileLoadButtonString() {
|
||||
if (this.timeline.flushMarker !== 0) {
|
||||
if (this.timeline.reloadNeeded) {
|
||||
return '+'
|
||||
} else {
|
||||
return this.newStatusCount > 99 ? '∞' : this.newStatusCount
|
||||
|
|
@ -167,9 +167,8 @@ const Timeline = {
|
|||
if (e.key === '.') this.showNewStatuses()
|
||||
},
|
||||
showNewStatuses() {
|
||||
if (this.timeline.flushMarker !== 0) {
|
||||
if (this.timeline.reloadNeeded) {
|
||||
useTimelinesStore().clearTimeline(this.timelineRef.name)
|
||||
useTimelinesStore().queueFlush(this.timelineRef.name, '')
|
||||
this.fetchOlderStatuses()
|
||||
} else {
|
||||
this.blockClicksTemporarily()
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ const timelineFetcher = (timeline, argument, credentials) => {
|
|||
return fetchTimeline(args)
|
||||
.then(({ data: statuses, pagination, timestamp }) => {
|
||||
if (!older && statuses.length >= 20 && numStatusesBeforeFetch > 0) {
|
||||
useTimelinesStore().queueFlush(timeline.name, timeline.maxId)
|
||||
useTimelinesStore().requireReload(timeline.name)
|
||||
}
|
||||
|
||||
if (older && statuses.length === 0) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ const emptyTl = (name, argument = null) => {
|
|||
maxId: '',
|
||||
minId: '',
|
||||
streaming: false,
|
||||
flushMarker: 0,
|
||||
reloadNeeded: false,
|
||||
fetcher: null,
|
||||
socket: null,
|
||||
}
|
||||
|
|
@ -158,7 +158,7 @@ export const useTimelinesStore = defineStore('timelines', {
|
|||
timeline.newStatusCount = 0
|
||||
timeline.maxId = ''
|
||||
timeline.minId = ''
|
||||
timeline.flushMarker = 0
|
||||
timeline.reloadNeeded = false
|
||||
},
|
||||
activatePersistents() {
|
||||
TIMELINES.forEach((name) => {
|
||||
|
|
@ -295,12 +295,12 @@ export const useTimelinesStore = defineStore('timelines', {
|
|||
syncOrder(timeline) {
|
||||
timeline.order = timeline.order.filter((id) => timeline.statusIds.has(id))
|
||||
},
|
||||
queueFlush(timeline, id) {
|
||||
this[timeline].flushMarker = id
|
||||
requireReload(timeline, id) {
|
||||
this[timeline].reloadNeeded = true
|
||||
},
|
||||
queueFlushAll() {
|
||||
requireReloadAll() {
|
||||
Object.keys(this).forEach((timeline) => {
|
||||
this[timeline].flushMarker = this[timeline].maxId
|
||||
this[timeline].reloadNeeded = true
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue