Skip to content

Commit

Permalink
added a check for window to avoid breaking node envs (#998)
Browse files Browse the repository at this point in the history
* added a check for window to avoid breaking node envs

addresses #992

* v0.11.22

---------

Co-authored-by: Chaitanya <yourchaitu@gmail.com>
  • Loading branch information
fffbbbccc and ChaituVR committed May 12, 2024
1 parent 2b4650a commit ab51c3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@snapshot-labs/snapshot.js",
"version": "0.11.21",
"version": "0.11.22",
"repository": "snapshot-labs/snapshot.js",
"license": "MIT",
"main": "dist/snapshot.cjs.js",
Expand Down
2 changes: 1 addition & 1 deletion src/sign/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class Client {
...domain
};
// @ts-ignore
if (window?.ethereum?.isTrust) {
if (typeof window !== 'undefined' && window.ethereum?.isTrust) {
domainData.chainId = (await signer.provider.getNetwork()).chainId;
}
const data: any = { domain: domainData, types, message };
Expand Down

0 comments on commit ab51c3d

Please sign in to comment.