move sortedBoards to getter

This commit is contained in:
Gamebrary 2020-09-01 10:43:19 -07:00
parent 4606b34688
commit 2a82ca3a26
2 changed files with 3 additions and 6 deletions

View file

@ -60,7 +60,6 @@
<script>
import CreateBoard from '@/components/Board/CreateBoard';
import orderby from 'lodash.orderby';
import { mapState, mapGetters } from 'vuex';
@ -77,11 +76,7 @@ export default {
computed: {
...mapState(['boards', 'platforms', 'platformNames', 'wallpapers']),
...mapGetters(['platformNames']),
sortedBoards() {
return orderby(this.boards, 'name');
},
...mapGetters(['platformNames', 'sortedBoards']),
},
mounted() {

View file

@ -11,6 +11,8 @@ export default {
return platforms.filter(({ id }) => id !== state.platform.id && gamePlatforms.includes(id));
},
sortedBoards: ({ boards }) => orderby(boards, 'name'),
filteredPlatforms: (state) => {
const filterField = state.settings.platformsFilterField || null;
const sortField = state.settings.platformsSortField || 'generation';