clear up queueFlush nonsense

This commit is contained in:
Henry Jameson 2026-08-24 15:01:59 +03:00
commit 1c1526c065
6 changed files with 14 additions and 15 deletions

View file

@ -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) {

View file

@ -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
})
},