-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mobile: show Landline transfers in history (#1300)
* backend for landline transfer * create landline history ui * show deposit immediately after creation * sync strategy for landline logs * show status, estimated arrival time and help message * fix lint issue * update memoization based on status * code cleanup and a test * update help copy and sort logic * code cleanup * lint fix and comment * landline change from date string to timestamp * fix test * change landlineaccount createdAt to string for backcompat
- Loading branch information
1 parent
db3a422
commit c918393
Showing
33 changed files
with
1,501 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
apps/daimo-mobile/src/logic/addr.tsx → apps/daimo-mobile/src/logic/eAccountCache.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { EAccount } from "@daimo/common"; | ||
import { Address } from "viem"; | ||
|
||
const nameCache = new Map<Address, EAccount>(); | ||
const eAccountCache = new Map<Address, EAccount>(); | ||
|
||
export function cacheEAccounts(accounts: EAccount[]) { | ||
for (const account of accounts) { | ||
nameCache.set(account.addr, account); | ||
eAccountCache.set(account.addr, account); | ||
} | ||
} | ||
|
||
export function getCachedEAccount(addr: Address): EAccount { | ||
return nameCache.get(addr) || { addr }; | ||
return eAccountCache.get(addr) || { addr }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { LandlineAccount } from "@daimo/common"; | ||
|
||
// Maps Landline account uuid to account | ||
const landlineAccountCache = new Map<string, LandlineAccount>(); | ||
|
||
export function cacheLandlineAccounts(accounts: LandlineAccount[]) { | ||
for (const account of accounts) { | ||
landlineAccountCache.set(account.landlineAccountUuid, account); | ||
} | ||
} | ||
|
||
export function getCachedLandlineAccount( | ||
landlineAccountUuid: string | ||
): LandlineAccount | null { | ||
return landlineAccountCache.get(landlineAccountUuid) || null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.