-
Notifications
You must be signed in to change notification settings - Fork 90
Issues with the in-chat payment request #19599
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
Conversation
Jenkins BuildsClick to see older builds (44)
|
6b9eea6 to
f623142
Compare
f623142 to
f05b508
Compare
| /** Token groups for chain, loaded on demand, without balances **/ | ||
| required property var tokenGroupsForChainModel | ||
| /** token groups that match the search keyword **/ | ||
| property var searchResultModel |
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.
- It would be nice to have some specification what roles/types are expected for that model.
- If there are some extra requirements (something not present in QAbstractModelItem by default) it should be also specified and clarified
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.
It would be nice to have also some top-level description what is this adaptor doing.
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.
@micieslak updated.
f05b508 to
759c886
Compare
| } | ||
|
|
||
| function onIsLoadingMoreChanged() { | ||
| root.fullOutputModel.isLoadingMore = root.tokenGroupsForChainModel.isLoadingMore |
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.
it's root.fullOutputModel and d.fullOutputModel few lines above. Which is correct?
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.
Well spotted!
|
|
||
|
|
||
| // output model - lazy loaded full model | ||
| readonly property SortFilterProxyModel fullOutputModel: SortFilterProxyModel { |
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.
There are ~50 identical lines in fullOutputModel and outputSearchResultModel.
Could you extract the common code in a groups model, and make sourceModel and other callbacks dynamic?
readonly property GroupsModel fullModel: GroupsModel {
objectName: "PaymentRequestAdaptor_fullModel"
sourceTokenModel: root.tokenGroupsForChainModel
flatNetworksModel: root.flatNetworksModel
selectedNetworkChainId: root.selectedNetworkChainId
function fetchMore() {
root.tokenGroupsForChainModel.fetchMore()
}
}
readonly property GroupsModel searchModel: GroupsModel {
objectName: "PaymentRequestAdaptor_searchModel"
sourceTokenModel: root.searchResultModel
flatNetworksModel: root.flatNetworksModel
selectedNetworkChainId: root.selectedNetworkChainId
function search(keyword) {
root.searchResultModel.search(keyword)
}
function fetchMore() {
root.searchResultModel.fetchMore()
}
}
Or make a separate qml component that handles everything under the hood:
readonly property var outputModel: !!d.searchKeyword ? d.outputSearchResultModel : d.fullOutputModel
->
readonly property var outputModel: d.groupModel
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.
Updated.
| ## | ||
| ## Itterates over all tokens for the given chain and returns the first token | ||
| ## that matches the symbol or name (cause some tokens have different symbols for EVM/BSC chains), case insensitive. | ||
| proc getTokenBySymbolOnChain*(self: Service, symbol: string, chainId: int): TokenItem = |
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 we just delete it?
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.
Unfortunatelly we cannot (unless we don't care about backward compatibillity). If we delete it we will break backward compatibility for an already received payment requests in the past.
759c886 to
991f653
Compare
991f653 to
38ec7f1
Compare
Khushboo-dev-cpp
left a comment
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.
LGTM :)
Also tested on macOS and works well!
Corresponding
status-goPR:Fixes #19518
Changes are backward compatible: