👔 Logic work for multi-page support

This commit is contained in:
Alicia Sykes
2022-04-30 23:28:58 +01:00
parent 52a0ba5a6c
commit eb9a5abec5
6 changed files with 23 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ import { searchTiles } from '@/utils/Search';
const HomeMixin = {
props: {
confPath: String,
subPageInfo: Object,
},
computed: {
sections() {
@@ -40,8 +40,9 @@ const HomeMixin = {
},
methods: {
async getConfigForRoute() {
if (this.confPath) { // Get config for sub-page
await this.$store.dispatch(Keys.INITIALIZE_MULTI_PAGE_CONFIG, this.confPath);
this.$store.commit(Keys.SET_CURRENT_SUB_PAGE, this.subPageInfo);
if (this.subPageInfo && this.subPageInfo.confPath) { // Get config for sub-page
await this.$store.dispatch(Keys.INITIALIZE_MULTI_PAGE_CONFIG, this.subPageInfo.confPath);
} else { // Otherwise, use main config
this.$store.commit(Keys.USE_MAIN_CONFIG);
}