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(
|
||||
function () {
|
||||
this.timeline.fetcher
|
||||
.fetchAndUpdate()
|
||||
.fetchAndUpdate({
|
||||
older: true,
|
||||
showImmediately: true,
|
||||
})
|
||||
.then(({ statuses }) => {
|
||||
if (statuses?.length === 0) {
|
||||
this.bottomedOut = true
|
||||
|
|
|
|||
|
|
@ -34,7 +34,8 @@ const fetchAndUpdate = ({
|
|||
const loggedIn = useUsersStore().loggedIn
|
||||
|
||||
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) {
|
||||
// When minId = 0 we need to fetch without maxId param
|
||||
|
|
@ -70,8 +71,6 @@ const fetchAndUpdate = ({
|
|||
.addNewStatuses({ statuses, timestamp })
|
||||
.filter(Boolean)
|
||||
|
||||
console.log(timeline.name, argument, showImmediately, processed.length)
|
||||
|
||||
useTimelinesStore().addStatusesToTimeline(
|
||||
timeline.name,
|
||||
argument,
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ const emptyTl = (name, argument = null) => {
|
|||
statuses: new Map(),
|
||||
visibleStatusesIds: new Set(),
|
||||
newStatusCount: 0,
|
||||
maxId: 0,
|
||||
minId: 0,
|
||||
minVisibleId: 0,
|
||||
maxId: '',
|
||||
minId: '',
|
||||
minVisibleId: '',
|
||||
loading: false,
|
||||
flushMarker: 0,
|
||||
fetcher: null,
|
||||
|
|
@ -167,13 +167,13 @@ export const useTimelinesStore = defineStore('timelines', {
|
|||
const minNew = pagination.maxId ?? min(...statuses) ?? ''
|
||||
const maxNew = pagination.minId ?? max(...statuses) ?? ''
|
||||
|
||||
const newer = maxNew > timeline.maxId || timeline.maxId === ''
|
||||
const older = minNew < timeline.minId || timeline.minId === ''
|
||||
const newer = maxNew > timeline.maxId
|
||||
const older = minNew < timeline.minId
|
||||
|
||||
if (newer) {
|
||||
if (newer || timeline.maxId === '') {
|
||||
timeline.maxId = maxNew
|
||||
}
|
||||
if (older) {
|
||||
if (older || timeline.minId === '') {
|
||||
timeline.minId = minNew
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue