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

@ -28,7 +28,7 @@ const QuickFilterSettings = {
path: 'replyVisibility', path: 'replyVisibility',
value: visibility, value: visibility,
}) })
useStatusesStore().queueFlushAll() useStatusesStore().requireReloadAll()
}, },
openTab(tab) { openTab(tab) {
useInterfaceStore().openSettingsModalTab(tab) useInterfaceStore().openSettingsModalTab(tab)

View file

@ -36,7 +36,7 @@ const ClutterTab = {
// Updating nested properties // Updating nested properties
watch: { watch: {
replyVisibility() { replyVisibility() {
useStatusesStore().queueFlushAll() useStatusesStore().requireReloadAll()
}, },
}, },
} }

View file

@ -266,7 +266,7 @@ const FilteringTab = {
// Updating nested properties // Updating nested properties
watch: { watch: {
replyVisibility() { replyVisibility() {
useStatusesStore().queueFlushAll() useStatusesStore().requireReloadAll()
}, },
muteFiltersObject() { muteFiltersObject() {
this.muteFiltersDraftObject = cloneDeep( this.muteFiltersDraftObject = cloneDeep(

View file

@ -63,17 +63,17 @@ const Timeline = {
return this.timeline.newStatusCount return this.timeline.newStatusCount
}, },
showLoadButton() { showLoadButton() {
return this.timeline.newStatusCount > 0 || this.timeline.flushMarker !== 0 return this.timeline.newStatusCount > 0 || this.timeline.reloadNeeded
}, },
loadButtonString() { loadButtonString() {
if (this.timeline.flushMarker !== 0) { if (this.timeline.reloadNeeded) {
return this.$t('timeline.reload') return this.$t('timeline.reload')
} else { } else {
return `${this.$t('timeline.show_new')} (${this.newStatusCount})` return `${this.$t('timeline.show_new')} (${this.newStatusCount})`
} }
}, },
mobileLoadButtonString() { mobileLoadButtonString() {
if (this.timeline.flushMarker !== 0) { if (this.timeline.reloadNeeded) {
return '+' return '+'
} else { } else {
return this.newStatusCount > 99 ? '∞' : this.newStatusCount return this.newStatusCount > 99 ? '∞' : this.newStatusCount
@ -167,9 +167,8 @@ const Timeline = {
if (e.key === '.') this.showNewStatuses() if (e.key === '.') this.showNewStatuses()
}, },
showNewStatuses() { showNewStatuses() {
if (this.timeline.flushMarker !== 0) { if (this.timeline.reloadNeeded) {
useTimelinesStore().clearTimeline(this.timelineRef.name) useTimelinesStore().clearTimeline(this.timelineRef.name)
useTimelinesStore().queueFlush(this.timelineRef.name, '')
this.fetchOlderStatuses() this.fetchOlderStatuses()
} else { } else {
this.blockClicksTemporarily() this.blockClicksTemporarily()

View file

@ -50,7 +50,7 @@ const timelineFetcher = (timeline, argument, credentials) => {
return fetchTimeline(args) return fetchTimeline(args)
.then(({ data: statuses, pagination, timestamp }) => { .then(({ data: statuses, pagination, timestamp }) => {
if (!older && statuses.length >= 20 && numStatusesBeforeFetch > 0) { if (!older && statuses.length >= 20 && numStatusesBeforeFetch > 0) {
useTimelinesStore().queueFlush(timeline.name, timeline.maxId) useTimelinesStore().requireReload(timeline.name)
} }
if (older && statuses.length === 0) { if (older && statuses.length === 0) {

View file

@ -16,7 +16,7 @@ const emptyTl = (name, argument = null) => {
maxId: '', maxId: '',
minId: '', minId: '',
streaming: false, streaming: false,
flushMarker: 0, reloadNeeded: false,
fetcher: null, fetcher: null,
socket: null, socket: null,
} }
@ -158,7 +158,7 @@ export const useTimelinesStore = defineStore('timelines', {
timeline.newStatusCount = 0 timeline.newStatusCount = 0
timeline.maxId = '' timeline.maxId = ''
timeline.minId = '' timeline.minId = ''
timeline.flushMarker = 0 timeline.reloadNeeded = false
}, },
activatePersistents() { activatePersistents() {
TIMELINES.forEach((name) => { TIMELINES.forEach((name) => {
@ -295,12 +295,12 @@ export const useTimelinesStore = defineStore('timelines', {
syncOrder(timeline) { syncOrder(timeline) {
timeline.order = timeline.order.filter((id) => timeline.statusIds.has(id)) timeline.order = timeline.order.filter((id) => timeline.statusIds.has(id))
}, },
queueFlush(timeline, id) { requireReload(timeline, id) {
this[timeline].flushMarker = id this[timeline].reloadNeeded = true
}, },
queueFlushAll() { requireReloadAll() {
Object.keys(this).forEach((timeline) => { Object.keys(this).forEach((timeline) => {
this[timeline].flushMarker = this[timeline].maxId this[timeline].reloadNeeded = true
}) })
}, },