File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -170,12 +170,15 @@ export class SessionKit {
170170 // Initialize session key support if configured
171171 if ( options . sessionKey ) {
172172 this . sessionKeyManager = new SessionKeyManager ( options . sessionKey , this . ui )
173- this . walletPlugins = [
174- ...this . walletPlugins ,
175- new SessionKeyWalletPlugin ( {
176- walletPlugins : this . walletPlugins ,
177- } ) ,
178- ]
173+ // Only add SessionKeyWalletPlugin to wallet picker if not disabled
174+ if ( ! options . sessionKey . disableWalletPlugin ) {
175+ this . walletPlugins = [
176+ ...this . walletPlugins ,
177+ new SessionKeyWalletPlugin ( {
178+ walletPlugins : this . walletPlugins ,
179+ } ) ,
180+ ]
181+ }
179182 }
180183 }
181184
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ export interface SessionKeyConfig {
3333 ) => Promise < API . v1 . AccountPermission | undefined >
3434 /** Skip showing consent UI to user during setup. Default is false. */
3535 skipConsent ?: boolean
36+ /** Disable SessionKeyWalletPlugin from appearing in the wallet picker. Default is false. */
37+ disableWalletPlugin ?: boolean
3638}
3739
3840/**
Original file line number Diff line number Diff line change @@ -222,6 +222,11 @@ export class SessionKeyWalletPlugin
222222 }
223223
224224 login ( context : LoginContext ) : Promise < WalletPluginLoginResponse > {
225+ if ( ! this . primaryWallet ) {
226+ throw new Error (
227+ 'Session key wallet is not configured. Please log in with a regular wallet first to set up a session key.'
228+ )
229+ }
225230 return this . primaryWallet . login ( context )
226231 }
227232
You can’t perform that action at this time.
0 commit comments