-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: show pending and failed transactions for nwc #3292
base: master
Are you sure you want to change the base?
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@getalby/[email protected], npm/@noble/[email protected], npm/[email protected], npm/[email protected] |
src/extension/background-script/connectors/connector.interface.ts
Outdated
Show resolved
Hide resolved
src/extension/background-script/connectors/connector.interface.ts
Outdated
Show resolved
Hide resolved
@@ -128,7 +128,7 @@ export default class LaWallet implements Connector { | |||
return { | |||
data: { | |||
transactions: parsedTransactions.sort( | |||
(a, b) => b.settleDate - a.settleDate | |||
(a, b) => (b.settleDate ?? 0) - (a.settleDate ?? 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this connector should be affected like this in this PR? if lawallet only has settled transactions, there is now extra code that does not even apply.
Can't you sort the transactions before mapping them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that was just to make typescript happy we have common type definitions for all the connectors. now settleDate can be either number | null (cause of nwc pending and failed transactions). any better approach here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you sort the transactions before mapping them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how this will solve the problem of settledDate being number | null. and avoid fallback value. its the type that is why we need fallback here. but it will never being triggered as all other transactions will returned settled transactions only
f245ef1
to
c44add1
Compare
show failed and pending transactions for nwc
Fixes #3291