Related to task: T1768 Breaking notifications into a separate component file.
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABC9ee726a3159c: [Cashtab] notification success & notification error added to Notifications.js
cd web/cashtab
npm start
send XEC, ensure notification works
create token, ensure notification works,
send token, ensure notification works
receive XEC, ensure notification works
receive token, ensure notification works,
set error notification to fire on load to view.
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
web/cashtab/src/components/Send/Send.js | ||
---|---|---|
15 ↗ | (On Diff #30582) | Correct import syntax but the Notifications file should be src/components/Common |
194 ↗ | (On Diff #30582) | Pass link param |
web/cashtab/src/components/Send/SendToken.js | ||
116 ↗ | (On Diff #30582) | need to pass the link param i.e. sendTokenNotification(link) |
web/cashtab/src/components/Tokens/CreateTokenForm.js | ||
19 ↗ | (On Diff #30582) | Put Notifications.js in src/components/Common , avoid using ../.. in imports; see pattern above import {createTokenNotification} from `@components/Common/Notifications |
138 ↗ | (On Diff #30582) | Need to pass the link param |
web/cashtab/src/hooks/Notifications.js | ||
1 ↗ | (On Diff #30582) | Move this file to the src/components/Common folder |
web/cashtab/src/hooks/useWallet.js | ||
20 ↗ | (On Diff #30582) | Can remove these imports now that they are handled in a separate Notifications file |
904 ↗ | (On Diff #30582) | Need to pass in the balances, previousBalances params here |
web/cashtab/src/components/Common/Notifications.js | ||
---|---|---|
102 ↗ | (On Diff #30597) | Remove this console.log statement |
116 ↗ | (On Diff #30597) | Remove. Use eTokenReceivedNotification for all token received cases. |
138 ↗ | (On Diff #30597) | Add a console.log statement here, as this can occasionally be useful when troubleshooting user reports. Make sure the console.log statement includes which function called it to better assist in debugging. For example: console.log(Error passed to sendXecErrorNotification`, message)` |
147 ↗ | (On Diff #30597) | Improve this console.log statement like the one above. Also -- why does this function accept an e parameter but sendXecErrorNotification does not? |
155 ↗ | (On Diff #30597) | Add in the function-referencing console.log statement as above. In fact, we should have only one error notification function that also accepts an event as a parameter, then logs that to the console. Please investigate and implement this approach unless there is some reason it's impractical. |
web/cashtab/src/components/Send/SendToken.js | ||
136 ↗ | (On Diff #30597) | ok i see what was going on here. Please make the generalized error notification accept three parameters: error, message, event then when you call it here, call it like errorNotification(error=e, message=message, event='Sending eToken') Then you can console.log the event param in the function to assist in app debugging. |
web/cashtab/src/components/Tokens/CreateTokenForm.js | ||
166 ↗ | (On Diff #30597) | Uncomment this + make sure it's the generic error notification as discussed in above comments |
web/cashtab/src/components/Common/Notifications.js | ||
---|---|---|
58 ↗ | (On Diff #30606) | Change name to xecReceivedNotification |
117 ↗ | (On Diff #30606) | be more specific with variable name than ev; use something like stringDescribingCallEvent |
web/cashtab/src/components/Send/Send.js | ||
223 ↗ | (On Diff #30606) | no need to spell this out, use errorNotification(e, message, 'Sending XEC') |
web/cashtab/src/components/Send/SendToken.js | ||
135 ↗ | (On Diff #30606) | same as earlier feedback, don't label parameters here |
web/cashtab/src/components/Tokens/CreateTokenForm.js | ||
55 ↗ | (On Diff #30606) | do a rebase to fix these prettier issues, we finally got the diff in that upgrades prettier for the whole web folder |
165 ↗ | (On Diff #30606) | same as earlier feedback, don't label parameters here |
Works great. Please rebase and remove unused imports.
web/cashtab/src/components/Send/Send.js | ||
---|---|---|
4 ↗ | (On Diff #30636) | Remove unused imports, in this case notification |
web/cashtab/src/components/Send/SendToken.js | ||
6 ↗ | (On Diff #30636) | Remove unused imports, in this case notification |
web/cashtab/src/components/Tokens/CreateTokenForm.js | ||
16 ↗ | (On Diff #30636) | Remove unused imports, in this case notification |