Skip to content

Commit

Permalink
Merge pull request #1262 from multiversx/development
Browse files Browse the repository at this point in the history
v2.40.4
  • Loading branch information
andreigiura committed Sep 19, 2024
2 parents 448c29a + bea9278 commit ddc5db2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]


## [[v2.40.4]](https://github.com/multiversx/mx-sdk-dapp/pull/1262)] - 2024-09-19
- [Fix extension button opening store when extension is installed](https://github.com/multiversx/mx-sdk-dapp/pull/1262)

## [[v2.40.3]](https://github.com/multiversx/mx-sdk-dapp/pull/1261)] - 2024-09-12
- [Update passkey provider](https://github.com/multiversx/mx-sdk-dapp/pull/1260)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-dapp",
"version": "2.40.3",
"version": "2.40.4",
"description": "A library to hold the main logic for a dapp on the MultiversX blockchain",
"author": "MultiversX",
"license": "GPL-3.0-or-later",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export interface ExtensionLoginButtonPropsType
disabled?: boolean;
}

const isExtensionAvailable = getIsExtensionAvailable();

const ExtensionLoginButtonComponent: (
props: ExtensionLoginButtonPropsType & WithStylesImportType
) => JSX.Element = ({
Expand Down Expand Up @@ -71,7 +69,7 @@ const ExtensionLoginButtonComponent: (
onInitiateLogin();
};

return !isExtensionAvailable ? (
return !getIsExtensionAvailable() ? (
<a
rel='noreferrer'
href={isFirefox ? FIREFOX_ADDON_LINK : CHROME_EXTENSION_LINK}
Expand Down
6 changes: 5 additions & 1 deletion src/utils/platform/getIsExtensionAvailable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { safeWindow } from 'lib/sdkDappUtils';
type SafeWindowType<T extends Window = Window> = {
[K in keyof T]?: T[K];
};

export const getIsExtensionAvailable = () => {
const safeWindow =
typeof window !== 'undefined' ? window : ({} as SafeWindowType);
return Boolean(safeWindow?.elrondWallet);
};

0 comments on commit ddc5db2

Please sign in to comment.