diff --git a/src/App.vue b/src/App.vue index 41b5e9e..4587216 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,14 +2,16 @@
- The Office Quotes - - XS - SM - MD - LG - XL - + + The Office Quotes + + + XS + SM + MD + LG + XL + @@ -23,29 +25,39 @@ About + + + Characters + + - + - - + + - + - + - +
@@ -119,16 +131,16 @@ export default { insightsClient: window.aa, }; }, + computed: { + showBreakpointMarker() { + return process.env.NODE_ENV === 'development'; + } + }, methods: { showResults() { if (this.$refs.searchbox.currentRefinement !== "" && this.$route.path !== "/search_results") this.$router.push({name: "SearchResults"}); }, - }, - computed: { - showBreakpointMarker() { - return process.env.NODE_ENV === 'development'; - } } }; diff --git a/src/store.js b/src/store.js index e67c41b..630bbe1 100644 --- a/src/store.js +++ b/src/store.js @@ -167,6 +167,17 @@ export default new Vuex.Store({ }, getCharacter: (state) => (character_id) => { return state.characters[character_id]; + }, + getSortedCharacters: (state) => () => { + let keys = Object.keys(state.characters); + console.log(keys) + keys.sort((a, b) => { + const a_count = state.characters[a].appearances; + const b_count = state.characters[b].appearances + if (a_count < b_count) return 1; + else return -1; + }) + return keys; } } });