more user profile work
This commit is contained in:
parent
1f3b9a3905
commit
3274a27f9e
3 changed files with 13 additions and 11 deletions
|
|
@ -182,7 +182,10 @@ const Timeline = {
|
||||||
fetchOlderStatuses: throttle(
|
fetchOlderStatuses: throttle(
|
||||||
function () {
|
function () {
|
||||||
this.timeline.fetcher
|
this.timeline.fetcher
|
||||||
.fetchAndUpdate()
|
.fetchAndUpdate({
|
||||||
|
older: true,
|
||||||
|
showImmediately: true,
|
||||||
|
})
|
||||||
.then(({ statuses }) => {
|
.then(({ statuses }) => {
|
||||||
if (statuses?.length === 0) {
|
if (statuses?.length === 0) {
|
||||||
this.bottomedOut = true
|
this.bottomedOut = true
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,8 @@ const fetchAndUpdate = ({
|
||||||
const loggedIn = useUsersStore().loggedIn
|
const loggedIn = useUsersStore().loggedIn
|
||||||
|
|
||||||
const args = { timeline: timeline.name, credentials }
|
const args = { timeline: timeline.name, credentials }
|
||||||
args[ARGUMENT_MAP[timeline.name]] = argument
|
const mainArg = ARGUMENT_MAP[timeline.name]
|
||||||
|
if (mainArg) args[mainArg] = argument
|
||||||
|
|
||||||
if (older) {
|
if (older) {
|
||||||
// When minId = 0 we need to fetch without maxId param
|
// When minId = 0 we need to fetch without maxId param
|
||||||
|
|
@ -70,8 +71,6 @@ const fetchAndUpdate = ({
|
||||||
.addNewStatuses({ statuses, timestamp })
|
.addNewStatuses({ statuses, timestamp })
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
|
|
||||||
console.log(timeline.name, argument, showImmediately, processed.length)
|
|
||||||
|
|
||||||
useTimelinesStore().addStatusesToTimeline(
|
useTimelinesStore().addStatusesToTimeline(
|
||||||
timeline.name,
|
timeline.name,
|
||||||
argument,
|
argument,
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ const emptyTl = (name, argument = null) => {
|
||||||
statuses: new Map(),
|
statuses: new Map(),
|
||||||
visibleStatusesIds: new Set(),
|
visibleStatusesIds: new Set(),
|
||||||
newStatusCount: 0,
|
newStatusCount: 0,
|
||||||
maxId: 0,
|
maxId: '',
|
||||||
minId: 0,
|
minId: '',
|
||||||
minVisibleId: 0,
|
minVisibleId: '',
|
||||||
loading: false,
|
loading: false,
|
||||||
flushMarker: 0,
|
flushMarker: 0,
|
||||||
fetcher: null,
|
fetcher: null,
|
||||||
|
|
@ -167,13 +167,13 @@ export const useTimelinesStore = defineStore('timelines', {
|
||||||
const minNew = pagination.maxId ?? min(...statuses) ?? ''
|
const minNew = pagination.maxId ?? min(...statuses) ?? ''
|
||||||
const maxNew = pagination.minId ?? max(...statuses) ?? ''
|
const maxNew = pagination.minId ?? max(...statuses) ?? ''
|
||||||
|
|
||||||
const newer = maxNew > timeline.maxId || timeline.maxId === ''
|
const newer = maxNew > timeline.maxId
|
||||||
const older = minNew < timeline.minId || timeline.minId === ''
|
const older = minNew < timeline.minId
|
||||||
|
|
||||||
if (newer) {
|
if (newer || timeline.maxId === '') {
|
||||||
timeline.maxId = maxNew
|
timeline.maxId = maxNew
|
||||||
}
|
}
|
||||||
if (older) {
|
if (older || timeline.minId === '') {
|
||||||
timeline.minId = minNew
|
timeline.minId = minNew
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue