From 3930c6f8d7a99c23a76faceeb57a37bf3ef281f1 Mon Sep 17 00:00:00 2001 From: Gavrila Andrei Date: Wed, 3 Jan 2024 17:26:37 +0200 Subject: [PATCH 1/3] Add timeout in order to allow redux store cleanup (#1004) * Add redirect delay in order to clear storage * Add changelog * Redo changes with default timeout * Remove property * Update changelog --- CHANGELOG.md | 1 + src/utils/logout.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6c3c8761..676b5c7ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- [Fix logout issue with web-wallet](https://github.com/multiversx/mx-sdk-dapp/pull/1004) ## [[v2.26.2]](https://github.com/multiversx/mx-sdk-dapp/pull/1003)] - 2023-12-21 diff --git a/src/utils/logout.ts b/src/utils/logout.ts index fe92d7970..fc6784a22 100644 --- a/src/utils/logout.ts +++ b/src/utils/logout.ts @@ -83,6 +83,14 @@ export async function logout( try { store.dispatch(logoutAction()); + + if (providerType === LoginMethodsEnum.wallet) { + // Allow redux store cleanup before redirect to web wallet + return setTimeout(() => { + provider.logout({ callbackUrl: url }); + }); + } + await provider.logout({ callbackUrl: url }); } catch (err) { console.error('error logging out', err); From a35a678aa4696a4ba7a7a173509677a5390b48ad Mon Sep 17 00:00:00 2001 From: Gavrila Andrei Date: Wed, 3 Jan 2024 17:29:41 +0200 Subject: [PATCH 2/3] 2.26.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9476d3ab2..36d3df1d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-dapp", - "version": "2.26.2", + "version": "2.26.3", "description": "A library to hold the main logic for a dapp on the MultiversX blockchain", "author": "MultiversX", "license": "GPL-3.0-or-later", From fda112f2869283b51faa0b4e2899cf3645f24bab Mon Sep 17 00:00:00 2001 From: Gavrila Andrei Date: Wed, 3 Jan 2024 17:31:25 +0200 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 676b5c7ef..fad480c7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [[v2.26.3]](https://github.com/multiversx/mx-sdk-dapp/pull/1005)] - 2024-01-03 - [Fix logout issue with web-wallet](https://github.com/multiversx/mx-sdk-dapp/pull/1004) ## [[v2.26.2]](https://github.com/multiversx/mx-sdk-dapp/pull/1003)] - 2023-12-21