From 0985346342dd47acdef5d38ce2b3444587e26035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blak?= Date: Mon, 25 Mar 2024 18:19:17 +0100 Subject: [PATCH] chore(CommunityIntroDialog): Fix storybook page --- storybook/pages/CommunityIntroDialogPage.qml | 5 +++++ ui/imports/shared/popups/CommunityIntroDialog.qml | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/storybook/pages/CommunityIntroDialogPage.qml b/storybook/pages/CommunityIntroDialogPage.qml index c3ac2ffbb6..95e4e6cba1 100644 --- a/storybook/pages/CommunityIntroDialogPage.qml +++ b/storybook/pages/CommunityIntroDialogPage.qml @@ -40,7 +40,12 @@ SplitView { CommunityIntroDialog { id: dialog + anchors.centerIn: parent + visible: true + modal: false + closePolicy: Popup.NoAutoClose + communityName: "Status" communityIcon: ModelsData.icons.status introMessage: "%1 sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. diff --git a/ui/imports/shared/popups/CommunityIntroDialog.qml b/ui/imports/shared/popups/CommunityIntroDialog.qml index dcbe0ba500..8bd7cf26e3 100644 --- a/ui/imports/shared/popups/CommunityIntroDialog.qml +++ b/ui/imports/shared/popups/CommunityIntroDialog.qml @@ -156,6 +156,7 @@ StatusStackModal { property var currentSharedAddressesMap: new Map() // Map[address, [keyUid, selected, isAirdrop]] - used in edit mode only property var selectedSharedAddressesMap: new Map() // Map[address, [keyUid, selected, isAirdrop]] + readonly property int selectedSharedAddressesCount: d.selectedSharedAddressesMap.size property var initialAddressesModel: SortFilterProxyModel { @@ -280,16 +281,19 @@ StatusStackModal { const tmpCurrentSharedAddressesMap = new Map() for (let i=0; i < d.initialAddressesModel.count; ++i){ const obj = d.initialAddressesModel.get(i) + if (!!obj) { + const lAddress = obj.address.toLowerCase() + let isAirdrop = i === 0 if (root.isEditMode) { if (root.currentSharedAddresses.indexOf(obj.address) === -1) { continue } - isAirdrop = obj.address.toLowerCase() === root.currentAirdropAddress.toLowerCase() + isAirdrop = lAddress === root.currentAirdropAddress.toLowerCase() } - tmpSharedAddressesMap.set(obj.address, {keyUid: obj.keyUid, selected: true, isAirdrop: isAirdrop}) - tmpCurrentSharedAddressesMap.set(obj.address, {keyUid: obj.keyUid, selected: true, isAirdrop: isAirdrop}) + tmpSharedAddressesMap.set(lAddress, {keyUid: obj.keyUid, selected: true, isAirdrop: isAirdrop}) + tmpCurrentSharedAddressesMap.set(lAddress, {keyUid: obj.keyUid, selected: true, isAirdrop: isAirdrop}) } } @@ -334,6 +338,7 @@ StatusStackModal { currentSharedAddressesMap: d.currentSharedAddressesMap totalNumOfAddressesForSharing: d.totalNumOfAddressesForSharing + profileProvesOwnershipOfSelectedAddresses: root.profileProvesOwnershipOfSelectedAddresses allAddressesToRevealBelongToSingleNonProfileKeypair: root.allAddressesToRevealBelongToSingleNonProfileKeypair