Skip to content

Commit

Permalink
fix(CommunityPermissionsSettingsPanel): fixing duplicates detection a…
Browse files Browse the repository at this point in the history
…nd permission updating

It's integral part of
#10166 but not pushed
together by mistake.
  • Loading branch information
micieslak committed Apr 5, 2023
1 parent ac01824 commit 9f3d351
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"])
Expand Down

0 comments on commit 9f3d351

Please sign in to comment.