1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-01-19 04:10:19 +01:00

refs #300 Apply filter to Favourites

This commit is contained in:
AkiraFukushima 2018-07-10 08:31:07 +09:00
parent 406d9fe54f
commit 48b959a322
3 changed files with 15 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<div v-shortkey="{linux: ['ctrl', 'r'], mac: ['meta', 'r']}" @shortkey="reload()">
</div>
<div class="fav" v-for="message in favourites" v-bind:key="message.id">
<toot :message="message" v-on:update="updateToot" v-on:delete="deleteToot"></toot>
<toot :message="message" :filter="filter" v-on:update="updateToot" v-on:delete="deleteToot"></toot>
</div>
<div class="loading-card" v-loading="lazyLoading" :element-loading-background="backgroundColor">
</div>
@ -23,7 +23,8 @@ export default {
favourites: state => state.TimelineSpace.Contents.Favourites.favourites,
lazyLoading: state => state.TimelineSpace.Contents.Favourites.lazyLoading,
backgroundColor: state => state.App.theme.background_color,
startReload: state => state.TimelineSpace.HeaderMenu.reload
startReload: state => state.TimelineSpace.HeaderMenu.reload,
filter: state => state.TimelineSpace.Contents.Favourites.filter
})
},
created () {

View File

@ -140,6 +140,9 @@ export default {
case 'notifications':
this.filter = this.$store.state.TimelineSpace.Contents.Notifications.filter
break
case 'favourites':
this.filter = this.$store.state.TimelineSpace.Contents.Favourites.filter
break
default:
console.log('Not implemented')
}
@ -152,6 +155,9 @@ export default {
case 'notifications':
this.$store.commit('TimelineSpace/Contents/Notifications/changeFilter', filter)
break
case 'favourites':
this.$store.commit('TimelineSpace/Contents/Favourites/changeFilter', filter)
break
default:
console.log('Not implemented')
}
@ -161,6 +167,7 @@ export default {
switch (this.$route.name) {
case 'home':
case 'notifications':
case 'favourites':
return true
default:
return false

View File

@ -4,7 +4,8 @@ const Favourites = {
namespaced: true,
state: {
favourites: [],
lazyLoading: false
lazyLoading: false,
filter: ''
},
mutations: {
updateFavourites (state, favourites) {
@ -40,6 +41,9 @@ const Favourites = {
},
changeLazyLoading (state, value) {
state.lazyLoading = value
},
changeFilter (state, filter) {
state.filter = filter
}
},
actions: {