Skip to content

Commit

Permalink
add: getters selector polkadot
Browse files Browse the repository at this point in the history
add: getters selector polkadot
  • Loading branch information
LukassF authored Feb 20, 2024
2 parents bbff671 + 52effa9 commit f975e44
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ export class NightlySelector extends LitElement {
@state()
isMobile = false

get qrCode() {
return (
'nc:' +
this.sessionId +
'?network=' +
this.chainName.replace(/\s/g, '') +
'&relay=' +
this.relay
)
}

// media queries

mobileQuery = window.matchMedia('(max-width: 640px)')
Expand Down
4 changes: 4 additions & 0 deletions sdk/packages/selector-base/src/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export class NightlyConnectSelectorModal {
return this._walletsList
}

get qrCode() {
return this._modal?.qrCode
}

set walletsList(list: IWalletListItem[]) {
const filtered = list.filter((w) =>
isMobileBrowser() ? w.walletType !== 'extension' : w.walletType !== 'mobile'
Expand Down
8 changes: 8 additions & 0 deletions sdk/packages/selector-polkadot/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ export class NightlyConnectAdapter implements Injected {
}
}

get sessionId() {
return this._app?.sessionId
}

get qrCode() {
if (this._modal) return this._modal.qrCode
}

public static initApp = async (
appInitData: AppSelectorInitialize
): Promise<[AppPolkadot, WalletMetadata[]]> => {
Expand Down

0 comments on commit f975e44

Please sign in to comment.