aboutsummaryrefslogtreecommitdiff
path: root/src/hocs
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2021-01-18 13:44:31 +0000
committerShpuld Shpludson <shp@cock.li>2021-01-18 13:44:31 +0000
commit320418d524a33c20d7d769c8d67a25be81f251ec (patch)
treeb15c3cb41b469e732db1060d9962ce80b10c9562 /src/hocs
parenta39866308cd7c8cb0d30a04a5215d1fae8bf8d47 (diff)
parent8f55cb151c546eae56c782c2ed4b292b04950e03 (diff)
Merge branch 'rc/2.2.3' into 'master'
rc 2.2.3 to MASTER See merge request pleroma/pleroma-fe!1328
Diffstat (limited to 'src/hocs')
-rw-r--r--src/hocs/with_load_more/with_load_more.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/hocs/with_load_more/with_load_more.js b/src/hocs/with_load_more/with_load_more.js
index 7df9dbb2..671b2b6f 100644
--- a/src/hocs/with_load_more/with_load_more.js
+++ b/src/hocs/with_load_more/with_load_more.js
@@ -29,12 +29,8 @@ const withLoadMore = ({
return {
loading: false,
bottomedOut: false,
- error: false
- }
- },
- computed: {
- entries () {
- return select(this.$props, this.$store) || []
+ error: false,
+ entries: []
}
},
created () {
@@ -48,6 +44,11 @@ const withLoadMore = ({
destroy && destroy(this.$props, this.$store)
},
methods: {
+ // Entries is not a computed because computed can't track the dynamic
+ // selector for changes and won't trigger after fetch.
+ updateEntries () {
+ this.entries = select(this.$props, this.$store) || []
+ },
fetchEntries () {
if (!this.loading) {
this.loading = true
@@ -61,6 +62,9 @@ const withLoadMore = ({
this.loading = false
this.error = true
})
+ .finally(() => {
+ this.updateEntries()
+ })
}
},
scrollLoad (e) {