parent
12520214d2
commit
c8d0cb36e6
|
@ -10,6 +10,7 @@ type
|
||||||
favourite*: bool
|
favourite*: bool
|
||||||
chainShortNames*: string
|
chainShortNames*: string
|
||||||
isTest*: bool
|
isTest*: bool
|
||||||
|
createdAt*: int64
|
||||||
|
|
||||||
proc newSavedAddressDto*(
|
proc newSavedAddressDto*(
|
||||||
name: string,
|
name: string,
|
||||||
|
@ -36,3 +37,4 @@ proc toSavedAddressDto*(jsonObj: JsonNode): SavedAddressDto =
|
||||||
discard jsonObj.getProp("favourite", result.favourite)
|
discard jsonObj.getProp("favourite", result.favourite)
|
||||||
discard jsonObj.getProp("chainShortNames", result.chainShortNames)
|
discard jsonObj.getProp("chainShortNames", result.chainShortNames)
|
||||||
discard jsonObj.getProp("isTest", result.isTest)
|
discard jsonObj.getProp("isTest", result.isTest)
|
||||||
|
discard jsonObj.getProp("createdAt", result.createdAt)
|
|
@ -36,7 +36,6 @@ proc newService*(events: EventEmitter, networkService: network_service.Service,
|
||||||
proc fetchAddresses(self: Service) =
|
proc fetchAddresses(self: Service) =
|
||||||
try:
|
try:
|
||||||
let response = backend.getSavedAddresses()
|
let response = backend.getSavedAddresses()
|
||||||
|
|
||||||
self.savedAddresses = map(
|
self.savedAddresses = map(
|
||||||
response.result.getElems(),
|
response.result.getElems(),
|
||||||
proc(x: JsonNode): SavedAddressDto = toSavedAddressDto(x)
|
proc(x: JsonNode): SavedAddressDto = toSavedAddressDto(x)
|
||||||
|
|
|
@ -9,6 +9,7 @@ import StatusQ.Core 0.1
|
||||||
import StatusQ.Core.Theme 0.1
|
import StatusQ.Core.Theme 0.1
|
||||||
import StatusQ.Popups 0.1
|
import StatusQ.Popups 0.1
|
||||||
import shared.controls 1.0
|
import shared.controls 1.0
|
||||||
|
import SortFilterProxyModel 0.2
|
||||||
|
|
||||||
import "../stores"
|
import "../stores"
|
||||||
import "../popups"
|
import "../popups"
|
||||||
|
@ -107,7 +108,10 @@ Item {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
visible: listView.count > 0
|
visible: listView.count > 0
|
||||||
spacing: 5
|
spacing: 5
|
||||||
model: RootStore.savedAddresses
|
model: SortFilterProxyModel {
|
||||||
|
sourceModel: RootStore.savedAddresses
|
||||||
|
sorters: RoleSorter { roleName: "createdAt"; sortOrder: Qt.DescendingOrder }
|
||||||
|
}
|
||||||
delegate: SavedAddressesDelegate {
|
delegate: SavedAddressesDelegate {
|
||||||
id: savedAddressDelegate
|
id: savedAddressDelegate
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 34badf2405043069ad1ee5a303b2a434c1fad53c
|
Subproject commit dd7c59423f125f7e40b7423e56ae03fe8cfba6a8
|
Loading…
Reference in New Issue