status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
303 stars 79 forks source link

[Share addresses dialog] Presented permissions come from different community #14200

Open micieslak opened 8 months ago

micieslak commented 8 months ago

Description

When the dialog is opened for one community but in the meantime other community receives permissions update, those permissions are presented in the current dialog.

Kazam_screencast_00101.webm

caybro commented 8 months ago

I believe it's this thing:

            permissionsModel: {
                root.rootStore.prepareTokenModelForCommunity(dialogRoot.communityId)
                return root.rootStore.permissionsModel
            }

repeated in many places ofc, and this in the RootStore:

    property string communityKeyToImport
    onCommunityKeyToImportChanged: {
        if (!!communityKeyToImport)
            root.prepareTokenModelForCommunity(communityKeyToImport);
    }

the CommunityMembershipSetupDialog dialog then accesses it using:

onAboutToShow: { root.rootStore.communityKeyToImport = dialogRoot.communityId; }

Introduced as part of this PR: https://github.com/status-im/status-desktop/pull/11774

noeliaSD commented 8 months ago

cc: @jrainville

alexjba commented 8 months ago

Related tasks (possibly duplicates): https://github.com/status-im/status-desktop/issues/12326 https://github.com/status-im/status-desktop/issues/14095

alexjba commented 8 months ago

Related tasks (possibly duplicates): #12326 #14200

It's definitely related. Just went down the rabbit hole with https://github.com/status-im/status-desktop/issues/14095 and I'll take this as well.

The only solution I see now is to move the permissions from community module and store to chat section. We need the ability to have access to multiple community permissions at the same time (spectated or not). Having all the logic in the chat section makes most sense to me.

noeliaSD commented 8 months ago

Related tasks (possibly duplicates): #12326 #14200

It's definitely related. Just went down the rabbit hole with #14095 and I'll take this as well.

The only solution I see now is to move the permissions from community module and store to chat section. We need the ability to have access to multiple community permissions at the same time (spectated or not). Having all the logic in the chat section makes most sense to me.

As discussed offline.. If the needed fix is too much, I'd suggest to postpone. In case of #14095 I don't see a lot of impact, since user can close the popup and open it again and, permissions are not upated constantly.. In case of this issue.. I'm not sure, bc the mix of permissions is really weird..

noeliaSD commented 6 months ago

First investigation and analyisis done but there's no time to finish it so moving it to next milestone!