forked from mirror/pixelfed
Merge pull request #745 from pixelfed/frontend-ui-refactor
Fix timeline bug
This commit is contained in:
commit
8aca53412c
File diff suppressed because one or more lines are too long
|
@ -2,6 +2,6 @@
|
||||||
"/js/activity.js": "/js/activity.js?id=7915246c3bc2b7e9770e",
|
"/js/activity.js": "/js/activity.js?id=7915246c3bc2b7e9770e",
|
||||||
"/js/app.js": "/js/app.js?id=ea57709b5a7ef8657ff4",
|
"/js/app.js": "/js/app.js?id=ea57709b5a7ef8657ff4",
|
||||||
"/css/app.css": "/css/app.css?id=0d2d3f52adde32658692",
|
"/css/app.css": "/css/app.css?id=0d2d3f52adde32658692",
|
||||||
"/js/components.js": "/js/components.js?id=aaa43ba1ed336fa3df29",
|
"/js/components.js": "/js/components.js?id=baa9a4a5416d4f10cba0",
|
||||||
"/js/timeline.js": "/js/timeline.js?id=83c85c7144756ee9a72e"
|
"/js/timeline.js": "/js/timeline.js?id=83c85c7144756ee9a72e"
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,7 +219,7 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
page: 1,
|
page: 2,
|
||||||
feed: [],
|
feed: [],
|
||||||
profile: {},
|
profile: {},
|
||||||
scope: window.location.pathname,
|
scope: window.location.pathname,
|
||||||
|
@ -228,6 +228,7 @@
|
||||||
notifications: {},
|
notifications: {},
|
||||||
stories: {},
|
stories: {},
|
||||||
suggestions: {},
|
suggestions: {},
|
||||||
|
loading: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -260,8 +261,8 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
fetchTimelineApi() {
|
fetchTimelineApi() {
|
||||||
let homeTimeline = '/api/v1/timelines/home?page=' + this.page;
|
let homeTimeline = '/api/v1/timelines/home?page=1';
|
||||||
let localTimeline = '/api/v1/timelines/public?page=' + this.page;
|
let localTimeline = '/api/v1/timelines/public?page=1';
|
||||||
let apiUrl = this.scope == '/' ? homeTimeline : localTimeline;
|
let apiUrl = this.scope == '/' ? homeTimeline : localTimeline;
|
||||||
axios.get(apiUrl).then(res => {
|
axios.get(apiUrl).then(res => {
|
||||||
$('.timeline .loader').addClass('d-none');
|
$('.timeline .loader').addClass('d-none');
|
||||||
|
@ -272,7 +273,7 @@
|
||||||
if(this.page == 1) {
|
if(this.page == 1) {
|
||||||
this.max_id = Math.max(...ids);
|
this.max_id = Math.max(...ids);
|
||||||
}
|
}
|
||||||
this.page++;
|
this.loading = false;
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -286,8 +287,7 @@
|
||||||
page: this.page,
|
page: this.page,
|
||||||
},
|
},
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.data.length) {
|
if (res.data.length && this.loading == false) {
|
||||||
$('.timeline .loader').addClass('d-none');
|
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
this.feed.push(...data);
|
this.feed.push(...data);
|
||||||
let ids = data.map(status => status.id);
|
let ids = data.map(status => status.id);
|
||||||
|
@ -297,6 +297,7 @@
|
||||||
}
|
}
|
||||||
this.page += 1;
|
this.page += 1;
|
||||||
$state.loaded();
|
$state.loaded();
|
||||||
|
this.loading = false;
|
||||||
} else {
|
} else {
|
||||||
$state.complete();
|
$state.complete();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue