🔥 Removes provides from App.vue, replaced with Store

This commit is contained in:
Alicia Sykes 2021-10-09 19:28:36 +01:00
parent b55f96c839
commit 5e6f78e6e7

View File

@ -11,8 +11,6 @@
import Header from '@/components/PageStrcture/Header.vue'; import Header from '@/components/PageStrcture/Header.vue';
import Footer from '@/components/PageStrcture/Footer.vue'; import Footer from '@/components/PageStrcture/Footer.vue';
import LoadingScreen from '@/components/PageStrcture/LoadingScreen.vue'; import LoadingScreen from '@/components/PageStrcture/LoadingScreen.vue';
// import { componentVisibility } from '@/utils/ConfigHelpers';
import ConfigAccumulator from '@/utils/ConfigAccumalator';
import { welcomeMsg } from '@/utils/CoolConsole'; import { welcomeMsg } from '@/utils/CoolConsole';
import ErrorHandler from '@/utils/ErrorHandler'; import ErrorHandler from '@/utils/ErrorHandler';
import { import {
@ -22,11 +20,6 @@ import {
language as defaultLanguage, language as defaultLanguage,
} from '@/utils/defaults'; } from '@/utils/defaults';
const Accumulator = new ConfigAccumulator();
const config2 = Accumulator.config();
// const visibleComponents = componentVisibility(config.appConfig) || defaultVisibleComponents;
const visibleComponents = defaultVisibleComponents;
export default { export default {
name: 'app', name: 'app',
components: { components: {
@ -34,15 +27,9 @@ export default {
Footer, Footer,
LoadingScreen, LoadingScreen,
}, },
provide: {
config: config2,
visibleComponents,
},
data() { data() {
return { return {
isLoading: true, // Set to false after mount complete isLoading: true, // Set to false after mount complete
showFooter: visibleComponents.footer,
visibleComponents,
}; };
}, },
computed: { computed: {
@ -66,6 +53,9 @@ export default {
sections() { sections() {
return this.$store.getters.pageInfo; return this.$store.getters.pageInfo;
}, },
visibleComponents() {
return this.$store.getters.visibleComponents;
},
}, },
created() { created() {
this.$store.dispatch('initializeConfig'); this.$store.dispatch('initializeConfig');