Skip to content

Commit

Permalink
Dev serve will now always load internal config
Browse files Browse the repository at this point in the history
  • Loading branch information
jolzee committed Feb 21, 2020
1 parent 5f2b83c commit a004577
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"prettier": "prettier --write **/*.{ts,js,css,html,json,vue}",
"release:dry-run": "release-it --dry-run",
"release": "release-it",
"serve": "cross-env LOCAL=true vue-cli-service serve --mode development --open"
"serve": "cross-env LOCAL=true cross-env VUE_APP_GET_STATIC_DEFAULT_CONFIG=false vue-cli-service serve --mode development --open"
},
"lint-staged": {
"*.{js,vue}": [
Expand Down
5 changes: 4 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,10 @@ export default {
this.loginPerformed = false;
// now end the Teneo Session - user clicked the close button - intention is clear
this.$store.dispatch("endSession").then(() => {
this.$store.commit("CLEAR_CHAT_HISTORY"); // clear the dialogs once we have successfully ended the session
setTimeout(() => {
this.$store.commit("CLEAR_CHAT_HISTORY");
}, 1000);
// clear the dialogs once we have successfully ended the session
// show the loading gif as the window is closing. Although delay a bit
// setTimeout(
Expand Down
1 change: 1 addition & 0 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ function storeSetup(vuetify) {
state.liveAgent.showLiveChatProcessing = false;
},
CLEAR_CHAT_HISTORY(state) {
logger.debug(`Clearing Chat History`);
state.conversation.dialog = [];
localStorage.setItem(STORAGE_KEY + config.TENEO_CHAT_HISTORY, "[]");
},
Expand Down
13 changes: 7 additions & 6 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ const brotliPluginTest = () => {
return test;
};

const useInternalSolutionConfig =
!process.env.VUE_APP_GET_STATIC_DEFAULT_CONFIG ||
process.env.VUE_APP_GET_STATIC_DEFAULT_CONFIG === "false";
const useStaticSolutionConfig = getEnvValue("VUE_APP_GET_STATIC_DEFAULT_CONFIG", false);

if (useInternalSolutionConfig) {
if (!useStaticSolutionConfig) {
console.log(`Solutions Config JSON = ${process.env.VUE_APP_SOLUTION_CONFIG_FILE}`);
} else {
console.log(`Solutions Config JSON = dist/static/default.json`);
}
const solutionConfigFile = getEnvValue("VUE_APP_SOLUTION_CONFIG_FILE", "./env.solution.json");

Expand Down Expand Up @@ -171,11 +171,12 @@ if (!isDev) {
);
}

if (!useInternalSolutionConfig) {
if (useStaticSolutionConfig) {
console.log(`Copying to solution config to > dist/static/default.json`);
buildConfig.configureWebpack.plugins.push(
new FileManagerPlugin({
onEnd: {
copy: [{ source: solutionConfigFile, destination: "./dist/static/default.json" }]
copy: [{ source: solutionConfigFile, destination: "dist/static/default.json" }]
}
})
);
Expand Down

0 comments on commit a004577

Please sign in to comment.