From ec4b88c89675c4039974f1be97c5d96343b1eb43 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 22 Dec 2021 12:38:44 +0300 Subject: [PATCH] Fix widget refreshing issue --- apps/public-web/src/EShopOnAbp.PublicWeb/Pages/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/index.js b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/index.js index 165df751..dcf084a6 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/index.js +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/index.js @@ -5,10 +5,6 @@ console.info("Anonymous user set:" + anonymousId); } - var widgetManager = new abp.WidgetManager({ - wrapper: $($('.abp-widget-wrapper[data-widget-name="CartWidget"]')[0]) - }); - $(function () { $('.product-list-item').click(function () { @@ -18,6 +14,10 @@ productId: productId, anonymousId: anonymousId, }).then(function () { + + let widgetManager = new abp.WidgetManager({ + wrapper: $($('.abp-widget-wrapper[data-widget-name="CartWidget"]')[0]) + }); widgetManager.refresh(); abp.notify.success("Added product to your basket.", "Successfully added"); });