mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-24 05:21:58 +00:00
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
d0a3b6ac55
commit
34fd4fc814
@ -80,7 +80,7 @@ SplitView {
|
||||
Button {
|
||||
enabled: showcasePanel.dirty
|
||||
text: "Save"
|
||||
onClicked: showcasePanel.saveSettings()
|
||||
onClicked: showcasePanel.saveSettings(false /* update */)
|
||||
}
|
||||
|
||||
Button {
|
||||
|
@ -74,7 +74,7 @@ SplitView {
|
||||
Button {
|
||||
enabled: showcasePanel.dirty
|
||||
text: "Save"
|
||||
onClicked: showcasePanel.saveSettings()
|
||||
onClicked: showcasePanel.saveSettings(false /* update */)
|
||||
}
|
||||
|
||||
Button {
|
||||
|
@ -357,7 +357,7 @@ Item {
|
||||
|
||||
// save
|
||||
verify(controlUnderTest.dirty)
|
||||
controlUnderTest.saveSettings()
|
||||
controlUnderTest.saveSettings(false /* update */)
|
||||
verify(!controlUnderTest.dirty)
|
||||
|
||||
// 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")
|
||||
|
||||
onSaveForLaterClicked: {
|
||||
manageTokensView.saveChanges()
|
||||
manageTokensView.saveChanges(false /* update */)
|
||||
}
|
||||
onSaveChangesClicked: {
|
||||
manageTokensView.saveChanges()
|
||||
manageTokensView.saveChanges(true /* update */)
|
||||
|
||||
if (manageTokensView.advancedTabVisible) {
|
||||
// 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 advancedTabVisible: tabBar.currentIndex === d.advancedTabIndex
|
||||
|
||||
function saveChanges() {
|
||||
loader.item.saveSettings()
|
||||
function saveChanges(update) {
|
||||
loader.item.saveSettings(update)
|
||||
}
|
||||
|
||||
function resetChanges() {
|
||||
|
@ -21,9 +21,12 @@ DoubleFlickableWithFolding {
|
||||
property var getCurrencyAmount: function (balance, symbol) {}
|
||||
property var getCurrentCurrencyAmount: function(balance) {}
|
||||
|
||||
function saveSettings() {
|
||||
function saveSettings(update) {
|
||||
let jsonSettings = root.controller.serializeSettingsAsJson()
|
||||
root.controller.requestSaveSettings(jsonSettings);
|
||||
if(update) {
|
||||
root.controller.requestLoadSettings();
|
||||
}
|
||||
}
|
||||
|
||||
function revert() {
|
||||
|
@ -18,9 +18,12 @@ DoubleFlickableWithFolding {
|
||||
readonly property bool dirty: root.controller.dirty
|
||||
readonly property bool hasSettings: root.controller.hasSettings
|
||||
|
||||
function saveSettings() {
|
||||
function saveSettings(update) {
|
||||
let jsonSettings = root.controller.serializeSettingsAsJson()
|
||||
root.controller.requestSaveSettings(jsonSettings)
|
||||
if(update) {
|
||||
root.controller.requestLoadSettings();
|
||||
}
|
||||
}
|
||||
|
||||
function revert() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user