Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: getters selector polkadot #97

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading