diff --git a/Example/DApp/Modules/Sign/SessionAccount/SessionAccountInteractor.swift b/Example/DApp/Modules/Sign/SessionAccount/SessionAccountInteractor.swift index d861b6ceb..83af42dac 100644 --- a/Example/DApp/Modules/Sign/SessionAccount/SessionAccountInteractor.swift +++ b/Example/DApp/Modules/Sign/SessionAccount/SessionAccountInteractor.swift @@ -7,6 +7,10 @@ struct AccountDetails { let chain: String let methods: [String] let account: String + + var id: String { + return "\(account)_\(chain)" + } } diff --git a/Example/DApp/Modules/Sign/SignPresenter.swift b/Example/DApp/Modules/Sign/SignPresenter.swift index 0b2e86e7d..474323b17 100644 --- a/Example/DApp/Modules/Sign/SignPresenter.swift +++ b/Example/DApp/Modules/Sign/SignPresenter.swift @@ -223,6 +223,7 @@ extension SignPresenter { self.session = session session.namespaces.values.forEach { namespace in namespace.accounts.forEach { account in + accountsDetails.removeAll() accountsDetails.append( AccountDetails( chain: account.blockchainIdentifier, diff --git a/Example/DApp/Modules/Sign/SignView.swift b/Example/DApp/Modules/Sign/SignView.swift index 03b4003a9..e29edc24f 100644 --- a/Example/DApp/Modules/Sign/SignView.swift +++ b/Example/DApp/Modules/Sign/SignView.swift @@ -96,7 +96,7 @@ struct SignView: View { .padding(12) } else { VStack { - ForEach(presenter.accountsDetails, id: \.chain) { account in + ForEach(presenter.accountsDetails, id: \.id) { account in Button { presenter.presentSessionAccount(sessionAccount: account) } label: {