From 226810f4de2603dcf8f7b5246e807523164010ad Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Wed, 11 May 2022 15:39:32 +0530 Subject: [PATCH] Fixes -- fixed issue that causes countdown to go negative when tabs are in background -- fixed issue where buy/sell percentage wouldn't calculate based on marked up prices -- fixed an issue where refresh button in wallet wouldn't refresh wallet balances --- docs/index.html | 94 ++++++++++++++++++++++++++++++------------------- 1 file changed, 58 insertions(+), 36 deletions(-) diff --git a/docs/index.html b/docs/index.html index 53ce990..dcbf704 100644 --- a/docs/index.html +++ b/docs/index.html @@ -328,7 +328,7 @@

Balance

- @@ -863,17 +863,20 @@ const relativeTime = new RelativeTime({ style: 'narrow' }); //Checks for internet connection status - if (!navigator.onLine) + if (!navigator.onLine) { notify( "There seems to be a problem connecting to the internet. Please check your internet connection.", "error", + { pinned: true } ); + } window.addEventListener("offline", () => { notify( "There seems to be a problem connecting to the internet. Please check your internet connection.", "error", { pinned: true } ); + location.reload() }); window.addEventListener("online", () => { getRef("notification_drawer").clearAll(); @@ -1088,6 +1091,7 @@ const pagesData = { lastPage: '', + currentPage: '', params: {} } async function showPage(targetPage, options = {}) { @@ -1123,6 +1127,7 @@ pageId = 'exchange' history.replaceState(null, null, '#/exchange') } + pagesData.currentPage = pageId if (!firstLoad) switch (pageId) { case 'exchange': @@ -1335,9 +1340,17 @@ child.classList.add('hide') }) } + function handleVisibilityChange() { + if (document.visibilityState === "hidden") { + // code if page is hidden + } else { + updateRate(); + } + } + document.addEventListener("visibilitychange", handleVisibilityChange, false);