From 4cd3f62421774aeb468dc64d30d9914ff723bff2 Mon Sep 17 00:00:00 2001 From: Kulbhushan Kaushik Date: Tue, 11 Oct 2022 12:03:03 -0400 Subject: [PATCH] commit --- src/main.js | 4 +++- src/router/index.js | 5 ++--- src/store/index.js | 2 -- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.js b/src/main.js index 4e8c1b3c..91c236c0 100644 --- a/src/main.js +++ b/src/main.js @@ -3,12 +3,14 @@ import App from './App.vue'; import router from './router'; import "../node_modules/bootstrap/dist/js/bootstrap.js"; import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'; -import { useMainStore, pinia } from '@/store'; +import { useMainStore, } from '@/store'; import baseMixin from "@/mixins/base-mixin.js"; +import { createPinia } from 'pinia'; const vueApp = createApp(App); // Pinia +const pinia = createPinia(); vueApp.use(pinia); pinia.use(piniaPluginPersistedstate); useMainStore().populateInitialState(); diff --git a/src/router/index.js b/src/router/index.js index cfacbfb1..ff0f0e2f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,7 +3,6 @@ import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader"; import {issPageValues} from '@/router/router-constants/issPage-values'; import { routingTable } from "@/router/router-constants/routing-table"; import { useMainStore } from '@/store'; -import { pinia } from "../store"; const routes = [ { @@ -55,7 +54,7 @@ const router = createRouter({ // Get route information by page name. // This will reach out to the Cms and there is a 1:1 relationship between page names and route names. async function GetRouteInfoFromPageName(pageName) { - const response = await useMainStore(pinia).getRouteInfo(pageName); + const response = await useMainStore().getRouteInfo(pageName); const jsonFromResponse = JSON.parse(response.data.Result); let routeData = []; @@ -123,7 +122,7 @@ function navigateToUrl(url, optionalQuery = {}) { function getNavigationMap (scenario, currentRoute) { const issPageValue = currentRoute.query.issPage; try { - const matchedQueryValue = routingTable(useMainStore(pinia)) + const matchedQueryValue = routingTable(useMainStore()) .filter( (item) => item.issPageValue === issPageValue && diff --git a/src/store/index.js b/src/store/index.js index 4aa75a25..56668172 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -92,5 +92,3 @@ export const useMainStore = defineStore({ }, persist: true }); - -export const pinia = createPinia(); \ No newline at end of file