Skip to content

Commit

Permalink
skip code block if in ssrg
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed May 1, 2024
1 parent 8bab69a commit 86e2d40
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ export function sequenceWaasWallet(params: BaseSequenceWaasConnectorOptions) {

const isConnected = await provider.sequenceWaas.isSignedIn()
if (!isConnected) {
const sessionHash = await provider.sequenceWaas.getSessionHash()
await config.storage?.setItem(LocalStorageKey.WaasSessionHash, sessionHash)
if (typeof window === 'object') {
// (for SSR) only run in browser client
const sessionHash = await provider.sequenceWaas.getSessionHash()
await config.storage?.setItem(LocalStorageKey.WaasSessionHash, sessionHash)
}
}

provider.on('disconnect', () => {
Expand Down

0 comments on commit 86e2d40

Please sign in to comment.