Skip to content

Commit ec75189

Browse files
author
Bob Potterveld
committed
Disable locale changes from menu while a session is active.
1 parent 4fd47e2 commit ec75189

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lex-web-ui/src/components/ToolbarContainer.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<v-container v-if="isLocaleSelectable">
4343
<v-list-tile v-for="(locale) in locales"
4444
v-bind:key=locale
45+
:disabled="restrictLocaleChanges"
4546
>
4647
<v-list-tile-title
4748
v-on:click="setLocale(locale)">
@@ -240,6 +241,15 @@ export default {
240241
isLocaleSelectable() {
241242
return this.$store.state.config.lex.v2BotLocaleId.split(',').length > 1;
242243
},
244+
restrictLocaleChanges() {
245+
return this.$store.state.lex.isProcessing
246+
|| ( this.$store.state.lex.sessionState
247+
&& this.$store.state.lex.sessionState.dialogAction
248+
&& this.$store.state.lex.sessionState.dialogAction.type === 'ElicitSlot')
249+
|| ( this.$store.state.lex.sessionState
250+
&& this.$store.state.lex.sessionState.intent
251+
&& this.$store.state.lex.sessionState.intent.state === 'InProgress')
252+
},
243253
currentLocale() {
244254
const priorLocale = localStorage.getItem('selectedLocale');
245255
if (priorLocale) {

0 commit comments

Comments
 (0)