fix(CommunityPermissionsSettingsPanel): fixing duplicates detection and permission updating

It's integral part of
https://github.com/status-im/status-desktop/pull/10166 but not pushed
together by mistake.
This commit is contained in:
Michał Cieślak 2023-04-05 13:15:57 +02:00 committed by Michał
parent ac01824ad5
commit 9f3d3514af
1 changed files with 10 additions and 5 deletions

View File

@ -213,8 +213,11 @@ SettingsPageLayout {
const same = (a, b) => ModelUtils.checkEqualitySet(a, b, ["key"])
if (holdings.rowCount() === 0 && dirtyValues.holdingsRequired)
continue
if (holdings.rowCount() === 0)
if (dirtyValues.holdingsRequired)
continue
else
return true
if (holdings.rowCount() !== 0 && !dirtyValues.holdingsRequired)
continue
@ -269,9 +272,11 @@ SettingsPageLayout {
target: d
function onSaveChanges() {
const holdings = ModelUtils.modelToArray(
dirtyValues.selectedHoldingsModel,
["key", "type", "amount"])
const holdings = dirtyValues.holdingsRequired ?
ModelUtils.modelToArray(
dirtyValues.selectedHoldingsModel,
["key", "type", "amount"])
: []
const channels = ModelUtils.modelToArray(
dirtyValues.selectedChannelsModel, ["key"])