Call fetchChannels after marking items as read
This commit is contained in:
parent
63fc43fb27
commit
f51f643bfa
|
|
@ -58,6 +58,8 @@
|
||||||
return this.$store.dispatch('markRead', {channel: channel, entry: item._id})
|
return this.$store.dispatch('markRead', {channel: channel, entry: item._id})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
item._is_read = true
|
item._is_read = true
|
||||||
|
}).then(() => {
|
||||||
|
this.$store.dispatch('fetchChannels')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleScroll() {
|
handleScroll() {
|
||||||
|
|
|
||||||
|
|
@ -175,15 +175,20 @@ export default new Vuex.Store({
|
||||||
},
|
},
|
||||||
bottomReached() {
|
bottomReached() {
|
||||||
let count = 0
|
let count = 0
|
||||||
this.state.timeline.items.forEach((item) => {
|
let uids = []
|
||||||
|
let items = this.state.timeline.items
|
||||||
|
uids = _.map(_.filter(items, item => !item._is_read), item => item._id)
|
||||||
|
items.forEach((item) => {
|
||||||
if (item && !item._is_read) {
|
if (item && !item._is_read) {
|
||||||
item._is_read = true
|
item._is_read = true
|
||||||
this.dispatch('markRead', {channel: this.state.channel.uid, entry: item._id})
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
this.dispatch('markRead', {channel: this.state.channel.uid, 'entry[]': uids})
|
||||||
|
.then(() => {
|
||||||
this.dispatch('fetchChannels')
|
this.dispatch('fetchChannels')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
startEventListening({commit}, url) {
|
startEventListening({commit}, url) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user