Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LukassF committed Oct 4, 2024
1 parent cec22df commit b0cf294
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sdk/apps/modal-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@nightlylabs/wallet-selector-aptos": "^0.1.12",
"@nightlylabs/wallet-selector-base": "^0.4.3",
"@nightlylabs/wallet-selector-polkadot": "0.2.7",
"@nightlylabs/wallet-selector-solana": "0.3.8",
"@nightlylabs/wallet-selector-solana": "0.3.9",
"@nightlylabs/wallet-selector-sui": "0.4.0",
"@polkadot/api": "^10.10.1",
"@polkadot/extension-inject": "^0.46.5",
Expand Down
2 changes: 1 addition & 1 deletion sdk/packages/selector-solana/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nightlylabs/wallet-selector-solana",
"version": "0.3.8",
"version": "0.3.9",
"description": "",
"type": "module",
"exports": {
Expand Down
17 changes: 10 additions & 7 deletions sdk/packages/selector-solana/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -898,19 +898,22 @@ export class NightlyConnectAdapter extends BaseMessageSignerWalletAdapter {
if (!this._connectionType) {
throw new Error('Not connected')
}
// check if we are connected with nightly wallet
if (this.selectedWallet?.name !== 'Nightly') {
throw new Error('Only supported on Nightly wallet')
}
// Check if remote connection is established
if (this._connectionType === ConnectionType.Nightly) {
await this._app!.changeNetwork({ genesisHash, url })
}
const response = await this._app!.changeNetwork({ genesisHash, url })
if (response.success) {
return
}

throw new Error('Network change unsuccessful')
}
// @ts-expect-error Window not declared
const nightlySolana = window.nightly?.solana

// check if we are connected with nightly wallet
if (this.selectedWallet?.name !== 'Nightly') {
throw new Error('Only supported on Nightly wallet')
}

await nightlySolana.changeNetwork({
genesisHash,
url
Expand Down
2 changes: 1 addition & 1 deletion sdk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b0cf294

Please sign in to comment.