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',
|
path: 'replyVisibility',
|
||||||
value: visibility,
|
value: visibility,
|
||||||
})
|
})
|
||||||
useStatusesStore().queueFlushAll()
|
useStatusesStore().requireReloadAll()
|
||||||
},
|
},
|
||||||
openTab(tab) {
|
openTab(tab) {
|
||||||
useInterfaceStore().openSettingsModalTab(tab)
|
useInterfaceStore().openSettingsModalTab(tab)
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ const ClutterTab = {
|
||||||
// Updating nested properties
|
// Updating nested properties
|
||||||
watch: {
|
watch: {
|
||||||
replyVisibility() {
|
replyVisibility() {
|
||||||
useStatusesStore().queueFlushAll()
|
useStatusesStore().requireReloadAll()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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(
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue