mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-03-14 06:06:15 +01:00
Fix photos not showing where the response is less big than limit
This commit is contained in:
parent
fba46f28ff
commit
c0c6dccdec
2 changed files with 6 additions and 3 deletions
|
@ -33,7 +33,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.data.length == 0 || response.data.length < this.limit) this.data_ended = true;
|
if (response.data.length == 0 || response.data.length < this.limit) this.data_ended = true;
|
||||||
else this.stream_data = this.stream_data.concat(response.data);
|
this.stream_data = this.stream_data.concat(response.data);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
loadMore() {
|
loadMore() {
|
||||||
|
|
|
@ -21,7 +21,8 @@ export default {
|
||||||
// this way we are sure that we fill the first page todo: check
|
// this way we are sure that we fill the first page todo: check
|
||||||
// 450 is a bit more of the max height of a post
|
// 450 is a bit more of the max height of a post
|
||||||
// todo: may not work in 4k screens :/
|
// todo: may not work in 4k screens :/
|
||||||
this.limit = Math.round(window.innerHeight / 450);
|
this.limit = Math.max(Math.round(window.innerHeight / 450), 1)
|
||||||
|
|
||||||
this.start_idx = 0;
|
this.start_idx = 0;
|
||||||
this.data_ended = false;
|
this.data_ended = false;
|
||||||
this.stream_data = [];
|
this.stream_data = [];
|
||||||
|
@ -50,9 +51,11 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.data.length == 0 || response.data.length < this.limit) this.data_ended = true;
|
if (response.data.length == 0 || response.data.length < this.limit) this.data_ended = true;
|
||||||
else this.stream_data = this.stream_data.concat(response.data);
|
this.stream_data = this.stream_data.concat(response.data);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
||||||
|
console.log(this.stream_data);
|
||||||
|
|
||||||
},
|
},
|
||||||
loadMore() {
|
loadMore() {
|
||||||
this.start_idx += this.limit
|
this.start_idx += this.limit
|
||||||
|
|
Loading…
Reference in a new issue