From a2764fd9967a0b9e87d3c4f3beab30c1a6924b10 Mon Sep 17 00:00:00 2001 From: John Feras Date: Mon, 20 May 2024 13:44:43 -0400 Subject: [PATCH] Put announcement info on tooltip --- .../src/components/AccountReceiveTable.vue | 41 ++++++++++++++----- frontend/src/i18n/locales/en-US.json | 7 +++- frontend/src/pages/AccountReceive.vue | 26 +++++++----- 3 files changed, 51 insertions(+), 23 deletions(-) diff --git a/frontend/src/components/AccountReceiveTable.vue b/frontend/src/components/AccountReceiveTable.vue index b1147bdd..ce851017 100644 --- a/frontend/src/components/AccountReceiveTable.vue +++ b/frontend/src/components/AccountReceiveTable.vue @@ -60,18 +60,39 @@ >. +
+ {{ $t('AccountReceiveTable.funds-question') }} + + + {{ $t('AccountReceiveTable.most-recent-announcement') }} +
+ {{ $t('AccountReceiveTable.most-recent-block') }} {{ mostRecentAnnouncementBlockNumber }} +
+ {{ $t('AccountReceiveTable.most-recent-time') }} + {{ formatDate(mostRecentAnnouncementTimestamp * 1000) }} + {{ formatTime(mostRecentAnnouncementTimestamp * 1000) }} +
+
+ {{ $t('AccountReceiveTable.most-recent-mined') }} +
+ {{ $t('AccountReceiveTable.most-recent-block') }} {{ mostRecentBlockNumber }} +
+ {{ $t('AccountReceiveTable.most-recent-time') }} + {{ formatDate(mostRecentBlockTimestamp * 1000) }} + {{ formatTime(mostRecentBlockTimestamp * 1000) }} +
+
+ + {{ $t('AccountReceiveTable.learn-more') }} + +
+
- {{ $t('AccountReceiveTable.most-recent-announcement') }} - {{ mostRecentAnnouncementBlockNumber }} / - {{ formatDate(mostRecentAnnouncementTimestamp * 1000) }} - {{ formatTime(mostRecentAnnouncementTimestamp * 1000) }} -
- {{ $t('AccountReceiveTable.most-recent-mined') }} - {{ mostRecentBlockNumber }} / - {{ formatDate(mostRecentBlockTimestamp * 1000) }} - {{ formatTime(mostRecentBlockTimestamp * 1000) }} -
{{ scanDescriptionString }}. diff --git a/frontend/src/i18n/locales/en-US.json b/frontend/src/i18n/locales/en-US.json index 17546885..53c88932 100644 --- a/frontend/src/i18n/locales/en-US.json +++ b/frontend/src/i18n/locales/en-US.json @@ -279,8 +279,11 @@ "loss-warning": "It looks like you're trying to withdraw your funds to a token contract. It is very likely this is not what you intend, and proceeding will likely result in a loss of funds. Do not proceed unless you know exactly what you are doing.", "i-know-what": "I know what I am doing", "danger": "Danger", - "most-recent-announcement": "Most recent announcement block / timestamp:", - "most-recent-mined": "Most recent mined block / timestamp:" + "most-recent-announcement": "Most recent announcement", + "most-recent-block": "Block Num:", + "most-recent-time": "TimeStamp:", + "most-recent-mined": "Most recent mined:", + "funds-question": "Where are my funds" }, "AccountReceiveTableWarning": { "withdrawal-warning": "You are withdrawing to {0}, which has the following warnings:", diff --git a/frontend/src/pages/AccountReceive.vue b/frontend/src/pages/AccountReceive.vue index d7472331..6cf8728e 100644 --- a/frontend/src/pages/AccountReceive.vue +++ b/frontend/src/pages/AccountReceive.vue @@ -242,6 +242,19 @@ function useScan() { return provider.getBlock('latest'); } + function updateMostRecentAnnouncementInfo(announcementsBatch: AnnouncementDetail[]) { + announcementsBatch.forEach((announcement) => { + const thisTimestamp = parseInt(announcement.timestamp); + if (thisTimestamp > mostRecentAnnouncementTimestamp.value) { + mostRecentAnnouncementTimestamp.value = thisTimestamp; + } + const thisBlock = parseInt(announcement.block); + if (thisBlock > mostRecentAnnouncementBlockNumber.value) { + mostRecentAnnouncementBlockNumber.value = thisBlock; + } + }); + } + async function scan() { // Reset paused state paused.value = false; @@ -302,6 +315,7 @@ function useScan() { if (advancedMode.value && scanPrivateKey.value) { for await (const announcementsBatch of umbra.value.fetchAllAnnouncements(overrides)) { announcementsCount += announcementsBatch.length; // Increment count + updateMostRecentAnnouncementInfo(announcementsBatch); announcementsQueue = [...announcementsQueue, ...announcementsBatch]; if (announcementsCount == 10000) { scanStatus.value = 'scanning latest'; @@ -338,17 +352,7 @@ function useScan() { } announcementsCount += announcementsBatch.length; // Increment count - announcementsBatch.forEach((announcement) => { - const thisTimestamp = parseInt(announcement.timestamp); - if (thisTimestamp > mostRecentAnnouncementTimestamp.value) { - mostRecentAnnouncementTimestamp.value = thisTimestamp; - } - const thisBlock = parseInt(announcement.block); - if (thisBlock > mostRecentAnnouncementBlockNumber.value) { - mostRecentAnnouncementBlockNumber.value = thisBlock; - } - }); - + updateMostRecentAnnouncementInfo(announcementsBatch); announcementsQueue = [...announcementsQueue, ...announcementsBatch]; if (announcementsCount == 10000) { scanStatus.value = 'scanning latest';