Page MenuHomePhabricator

No OneTemporary

diff --git a/cashtab/package-lock.json b/cashtab/package-lock.json
index 75eb85aa6..e0d76ea7e 100644
--- a/cashtab/package-lock.json
+++ b/cashtab/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "cashtab",
- "version": "3.14.1",
+ "version": "3.14.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cashtab",
- "version": "3.14.1",
+ "version": "3.14.2",
"dependencies": {
"@bitgo/utxo-lib": "^11.0.0",
"@zxing/browser": "^0.1.4",
diff --git a/cashtab/package.json b/cashtab/package.json
index 839d17e27..843892a96 100644
--- a/cashtab/package.json
+++ b/cashtab/package.json
@@ -1,6 +1,6 @@
{
"name": "cashtab",
- "version": "3.14.1",
+ "version": "3.14.2",
"private": true,
"scripts": {
"start": "node scripts/start.js",
diff --git a/cashtab/src/components/Agora/index.tsx b/cashtab/src/components/Agora/index.tsx
index 78c141063..efb672d31 100644
--- a/cashtab/src/components/Agora/index.tsx
+++ b/cashtab/src/components/Agora/index.tsx
@@ -101,7 +101,7 @@ const Agora: React.FC = () => {
// and patient
const [loadAllZeOffers, setLoadAllZeOffers] = useState<boolean>(false);
- // On load, immediately show whitelisted tokens
+ // State variable to hold the token orderbooks we present to the user
const [renderedTokenIds, setRenderedTokenIds] = useState<null | string[]>(
null,
);
@@ -291,6 +291,9 @@ const Agora: React.FC = () => {
}
}
+ // Handle token caching for initially rendered tokens
+ addUncachedTokensToCacheAndUpdateCache(initRenderedTokens);
+
// Set this now and do the rest of our calcs below in the background, as we only need them
// if the user wants to see all
setWhitelistedTokensWithOffers(initRenderedTokens);
@@ -367,7 +370,13 @@ const Agora: React.FC = () => {
// Even though we load with a limitied whitelist, we still cache all tokens in the background
- // Build an array of promises to get token info for all unknown tokens
+ // Handle token caching for all tokens
+ addUncachedTokensToCacheAndUpdateCache(tokenIdsWeNeedToCache);
+ };
+
+ const addUncachedTokensToCacheAndUpdateCache = async (
+ tokenIdsWeNeedToCache: string[],
+ ) => {
const tokenInfoPromises = [];
for (const tokenId of Array.from(tokenIdsWeNeedToCache)) {
tokenInfoPromises.push(

File Metadata

Mime Type
text/x-diff
Expires
Sun, Mar 2, 12:16 (23 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187813
Default Alt Text
(2 KB)

Event Timeline