Currently when registering a new alias it won't appear in the Registered Aliases section of Alias.js until 1) alias cache has re-synchronized and 2) page refresh. This diff ensures both occurs upon successful broadcast of a registration so users are not left wondering whether their registration was successful or not.
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABC66d0343938db: [Cashtab] [Alias] Real time update of Registered Aliases list upon new…
- enable Alias to true in ticker.js
- npm start
- navigate to Alias.js and register a new alias. Observe it is displayed
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
web/cashtab/src/components/Alias/Alias.js | ||
---|---|---|
78 ↗ | (On Diff #38373) | remove aliasRefreshTrigger flag |
126 ↗ | (On Diff #38373) | remove flag |
181 ↗ | (On Diff #38373) | Issue with this flag approach User story
Instead of using the flag to force a re-entry to the useEffect loop, just add the alias to the screen as pending. This is kind of hacky but imo a user friendly first step. The "right" way to do this, which will be quite nice when we get it in, is to use our existing websocket connection to monitor for when this tx confirms, and then (if it is indeed valid), remove the pending. So, instead of setAliasRefreshTrigger(true); setActiveWalletAliases([...activeWalletAliases, `${aliasInput} (pending)`]) |
Removed aliasRefreshTrigger and adopted the temporary ${aliasInput} (pending) approach. However it's coming up as undefined.xec which is presumably due to a a refresh occuring immediately before it. Removing the synchronizeAliasCache call after successful registration broadcast didn't resolve it either. Still investigating what is interferring with this activeWalletAliases state variable.