@@ -357,6 +357,10 @@ export class SessionKit {
357357 */
358358 async login ( options ?: LoginOptions ) : Promise < LoginResult > {
359359 try {
360+ const selectableWalletPlugins = this . walletPlugins . filter (
361+ ( plugin ) => plugin . id !== 'session-key-wallet'
362+ )
363+
360364 // Create LoginContext for this login request.
361365 const context = new LoginContext ( {
362366 appName : this . appName ,
@@ -369,41 +373,19 @@ export class SessionKit {
369373 fetch : this . fetch ,
370374 loginPlugins : this . loginPlugins ,
371375 ui : this . ui ,
372- walletPlugins : this . walletPlugins
373- . filter ( ( plugin ) => {
374- // Hide session key wallet from picker if disableWalletPlugin is set
375- if (
376- this . sessionKeyManager ?. config . disableWalletPlugin &&
377- plugin . id === 'session-key-wallet'
378- ) {
379- return false
380- }
381- return true
382- } )
383- . map ( ( plugin ) : UserInterfaceWalletPlugin => {
384- return {
385- config : plugin . config ,
386- metadata : WalletPluginMetadata . from ( plugin . metadata ) ,
387- retrievePublicKey : plugin . retrievePublicKey ?. bind ( plugin ) ,
388- }
389- } ) ,
376+ walletPlugins : selectableWalletPlugins . map ( ( plugin ) : UserInterfaceWalletPlugin => {
377+ return {
378+ config : plugin . config ,
379+ metadata : WalletPluginMetadata . from ( plugin . metadata ) ,
380+ retrievePublicKey : plugin . retrievePublicKey ?. bind ( plugin ) ,
381+ }
382+ } ) ,
390383 sessionKeyManager : this . sessionKeyManager ,
391384 } )
392385
393386 // Tell the UI a login request is beginning.
394387 await context . ui . onLogin ( )
395388
396- // Get the list of selectable wallet plugins (excluding hidden ones like session key wallet)
397- const selectableWalletPlugins = this . walletPlugins . filter ( ( plugin ) => {
398- if (
399- this . sessionKeyManager ?. config . disableWalletPlugin &&
400- plugin . id === 'session-key-wallet'
401- ) {
402- return false
403- }
404- return true
405- } )
406-
407389 // Predetermine WalletPlugin (if possible) to prevent uneeded UI interactions.
408390 let walletPlugin : WalletPlugin | undefined = undefined
409391 if ( selectableWalletPlugins . length === 1 ) {
0 commit comments