From cebf1e57b6fd57fba0cd010ed5195017b1aabc6a Mon Sep 17 00:00:00 2001 From: Pablo Costantini Date: Thu, 23 Feb 2017 21:35:08 -0300 Subject: [PATCH] ContosoFlowers fix for retrieving saved addresses --- Node/demo-ContosoFlowers/bot/dialogs/address.js | 4 ++-- Node/demo-ContosoFlowers/bot/dialogs/settings.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Node/demo-ContosoFlowers/bot/dialogs/address.js b/Node/demo-ContosoFlowers/bot/dialogs/address.js index ee28885b04..d49c3bdad5 100644 --- a/Node/demo-ContosoFlowers/bot/dialogs/address.js +++ b/Node/demo-ContosoFlowers/bot/dialogs/address.js @@ -68,8 +68,8 @@ lib.dialog('billing', [ var message = new builder.Message(session) .attachmentLayout(builder.AttachmentLayout.carousel); - var homeAddress = saved[UseSavedInfoChoices.Home]; - var workAddress = saved[UseSavedInfoChoices.Work]; + var homeAddress = saved[session.gettext(UseSavedInfoChoices.Home)]; + var workAddress = saved[session.gettext(UseSavedInfoChoices.Work)]; if (homeAddress) message.addAttachment(createAddressCard(session, session.gettext(UseSavedInfoChoices.Home), homeAddress)); if (workAddress) message.addAttachment(createAddressCard(session, session.gettext(UseSavedInfoChoices.Work), workAddress)); message.addAttachment(createAddressCard(session, session.gettext(UseSavedInfoChoices.NotThisTime), 'add_new_address')); diff --git a/Node/demo-ContosoFlowers/bot/dialogs/settings.js b/Node/demo-ContosoFlowers/bot/dialogs/settings.js index 3066a42cde..8c2dfb8de5 100644 --- a/Node/demo-ContosoFlowers/bot/dialogs/settings.js +++ b/Node/demo-ContosoFlowers/bot/dialogs/settings.js @@ -91,8 +91,8 @@ lib.dialog('addresses', [ var saved = session.userData.billingAddresses = session.userData.billingAddresses || {}; var message = new builder.Message(session) .attachmentLayout(builder.AttachmentLayout.carousel); - var homeAddress = saved[UseSavedInfoChoices.Home]; - var workAddress = saved[UseSavedInfoChoices.Work]; + var homeAddress = saved[session.gettext(UseSavedInfoChoices.Home)]; + var workAddress = saved[session.gettext(UseSavedInfoChoices.Work)]; var notSet = session.gettext('not_set'); message.addAttachment(createAddressCard(session, session.gettext(UseSavedInfoChoices.Home), homeAddress || notSet)); message.addAttachment(createAddressCard(session, session.gettext(UseSavedInfoChoices.Work), workAddress || notSet));