Browse Source

refactored refresh logic

pull/1207/head
Vijay Bikka 5 years ago
parent
commit
6ae7b49e88
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      src/Web/WebMVC/Views/Shared/_Layout.cshtml

+ 6
- 4
src/Web/WebMVC/Views/Shared/_Layout.cshtml View File

@ -111,7 +111,6 @@
connection.start().then(function () { connection.start().then(function () {
console.log('User Registered to Signalr Hub'); console.log('User Registered to Signalr Hub');
console.log('@settings.Value.SignalrHubUrl/hub/notificationhub');
cb(connection); cb(connection);
}); });
} }
@ -126,7 +125,7 @@
connection.on("UpdateBasketCount", (message) => { connection.on("UpdateBasketCount", (message) => {
//refresh the page for the latest count to get shown //refresh the page for the latest count to get shown
refreshOrderList();
refreshPage();
}); });
} }
@ -135,8 +134,11 @@
} }
function refreshOrderList() { function refreshOrderList() {
console.log('In refreshOrderList method');
clearTimeout(timerId);
refreshPage();
}
function refreshPage() {
clearTimeout(timerId);
timerId = setTimeout(function () { timerId = setTimeout(function () {
window.location.reload(); window.location.reload();
}, 1000); }, 1000);


Loading…
Cancel
Save