fix(wallet): update wallet assets and collectibles order on user action
Add a specific state to the saveSettings action to update the model by reloading the data. The previous implementation was using the same save address which doesn't update. Either in the past there was a side effect that made it work or it was never working. Closes #14365
This commit is contained in:
parent
180932b799
commit
b9271005cd
|
@ -80,7 +80,7 @@ SplitView {
|
||||||
Button {
|
Button {
|
||||||
enabled: showcasePanel.dirty
|
enabled: showcasePanel.dirty
|
||||||
text: "Save"
|
text: "Save"
|
||||||
onClicked: showcasePanel.saveSettings()
|
onClicked: showcasePanel.saveSettings(false /* update */)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
|
@ -74,7 +74,7 @@ SplitView {
|
||||||
Button {
|
Button {
|
||||||
enabled: showcasePanel.dirty
|
enabled: showcasePanel.dirty
|
||||||
text: "Save"
|
text: "Save"
|
||||||
onClicked: showcasePanel.saveSettings()
|
onClicked: showcasePanel.saveSettings(false /* update */)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|
|
@ -357,7 +357,7 @@ Item {
|
||||||
|
|
||||||
// save
|
// save
|
||||||
verify(controlUnderTest.dirty)
|
verify(controlUnderTest.dirty)
|
||||||
controlUnderTest.saveSettings()
|
controlUnderTest.saveSettings(false /* update */)
|
||||||
verify(!controlUnderTest.dirty)
|
verify(!controlUnderTest.dirty)
|
||||||
|
|
||||||
// load the settings and check BigKitty is still on top
|
// load the settings and check BigKitty is still on top
|
||||||
|
|
|
@ -68,10 +68,10 @@ SettingsContentBase {
|
||||||
toast.changesDetectedText: manageTokensView.advancedTabVisible ? toast.defaultChangesDetectedText : qsTr("New custom sort order created")
|
toast.changesDetectedText: manageTokensView.advancedTabVisible ? toast.defaultChangesDetectedText : qsTr("New custom sort order created")
|
||||||
|
|
||||||
onSaveForLaterClicked: {
|
onSaveForLaterClicked: {
|
||||||
manageTokensView.saveChanges()
|
manageTokensView.saveChanges(false /* update */)
|
||||||
}
|
}
|
||||||
onSaveChangesClicked: {
|
onSaveChangesClicked: {
|
||||||
manageTokensView.saveChanges()
|
manageTokensView.saveChanges(true /* update */)
|
||||||
|
|
||||||
if (manageTokensView.advancedTabVisible) {
|
if (manageTokensView.advancedTabVisible) {
|
||||||
// don't emit toasts when the Advanced tab is visible
|
// don't emit toasts when the Advanced tab is visible
|
||||||
|
|
|
@ -42,8 +42,8 @@ Item {
|
||||||
readonly property bool dirty: !!loader.item && loader.item.dirty
|
readonly property bool dirty: !!loader.item && loader.item.dirty
|
||||||
readonly property bool advancedTabVisible: tabBar.currentIndex === d.advancedTabIndex
|
readonly property bool advancedTabVisible: tabBar.currentIndex === d.advancedTabIndex
|
||||||
|
|
||||||
function saveChanges() {
|
function saveChanges(update) {
|
||||||
loader.item.saveSettings()
|
loader.item.saveSettings(update)
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetChanges() {
|
function resetChanges() {
|
||||||
|
|
|
@ -21,9 +21,12 @@ DoubleFlickableWithFolding {
|
||||||
property var getCurrencyAmount: function (balance, symbol) {}
|
property var getCurrencyAmount: function (balance, symbol) {}
|
||||||
property var getCurrentCurrencyAmount: function(balance) {}
|
property var getCurrentCurrencyAmount: function(balance) {}
|
||||||
|
|
||||||
function saveSettings() {
|
function saveSettings(update) {
|
||||||
let jsonSettings = root.controller.serializeSettingsAsJson()
|
let jsonSettings = root.controller.serializeSettingsAsJson()
|
||||||
root.controller.requestSaveSettings(jsonSettings);
|
root.controller.requestSaveSettings(jsonSettings);
|
||||||
|
if(update) {
|
||||||
|
root.controller.requestLoadSettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function revert() {
|
function revert() {
|
||||||
|
|
|
@ -18,9 +18,12 @@ DoubleFlickableWithFolding {
|
||||||
readonly property bool dirty: root.controller.dirty
|
readonly property bool dirty: root.controller.dirty
|
||||||
readonly property bool hasSettings: root.controller.hasSettings
|
readonly property bool hasSettings: root.controller.hasSettings
|
||||||
|
|
||||||
function saveSettings() {
|
function saveSettings(update) {
|
||||||
let jsonSettings = root.controller.serializeSettingsAsJson()
|
let jsonSettings = root.controller.serializeSettingsAsJson()
|
||||||
root.controller.requestSaveSettings(jsonSettings)
|
root.controller.requestSaveSettings(jsonSettings)
|
||||||
|
if(update) {
|
||||||
|
root.controller.requestLoadSettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function revert() {
|
function revert() {
|
||||||
|
|
Loading…
Reference in New Issue