@@ -64,6 +64,7 @@ export interface NodeLoginDataInterface {
6464 node : CustomNodeConfiguration ;
6565 apiKey : string ;
6666 clusterTag ?: string ;
67+ connectionTimeoutSeconds ?: number ;
6768}
6869
6970export interface NodeLoginPayloadInterface extends NodeLoginDataInterface {
@@ -179,10 +180,14 @@ export const useNodeStore = defineStore('node', {
179180 api = electron ;
180181 ( electron as any ) . rejectTLS ( Number ( state . loginData . node . tls ) ) ;
181182 }
182- api . init ( {
183+ const initConfig : Parameters < typeof api . init > [ 0 ] = {
183184 node : { ...state . loginData . node } ,
184185 apiKey : state . loginData . apiKey ,
185- } ) ;
186+ } ;
187+ if ( state . loginData . connectionTimeoutSeconds !== undefined ) {
188+ initConfig . connectionTimeoutSeconds = state . loginData . connectionTimeoutSeconds ;
189+ }
190+ api . init ( initConfig ) ;
186191 return api ;
187192 }
188193 } ,
@@ -474,7 +479,7 @@ export const useNodeStore = defineStore('node', {
474479 } ) ;
475480 } ,
476481 login ( loginData : NodeLoginPayloadInterface ) {
477- const { apiKey, node, forceHomeRedirect = false } = loginData ;
482+ const { apiKey, node, forceHomeRedirect = false , connectionTimeoutSeconds } = loginData ;
478483 let { clusterTag } = loginData ;
479484 // Recover clusterTag from history if not provided
480485 if ( ! clusterTag ) {
@@ -493,7 +498,14 @@ export const useNodeStore = defineStore('node', {
493498 }
494499 this . setForceRedirect ( forceHomeRedirect ) ;
495500 this . setCurrentNodeConfig ( node ) ;
496- this . setNodeData ( { apiKey, node, clusterTag } as NodeLoginDataInterface ) ;
501+ const nodeData : NodeLoginDataInterface = { apiKey, node } ;
502+ if ( clusterTag !== undefined ) {
503+ nodeData . clusterTag = clusterTag ;
504+ }
505+ if ( connectionTimeoutSeconds !== undefined ) {
506+ nodeData . connectionTimeoutSeconds = connectionTimeoutSeconds ;
507+ }
508+ this . setNodeData ( nodeData ) ;
497509 void this . connectionCheck ( ) ;
498510 } ,
499511 logout ( ) {
@@ -898,6 +910,9 @@ export const useNodeStore = defineStore('node', {
898910 apiKey : parsed . apiKey ,
899911 clusterTag : tag ,
900912 } ;
913+ if ( parsed . connectionTimeoutSeconds !== undefined ) {
914+ updated . connectionTimeoutSeconds = parsed . connectionTimeoutSeconds ;
915+ }
901916 this . loginHistory . splice ( index , 1 , JSON . stringify ( updated ) ) ;
902917 LocalStorage . set ( STORAGE_KEY_LOGIN_HISTORY , this . loginHistory ) ;
903918 if ( this . loginData ) {
@@ -908,6 +923,9 @@ export const useNodeStore = defineStore('node', {
908923 if ( index < 0 || index >= this . loginHistoryParsed . length ) return ;
909924 const base = this . loginHistoryParsed [ index ] as NodeLoginDataInterface ;
910925 const noTag : NodeLoginDataInterface = { node : base . node , apiKey : base . apiKey } ;
926+ if ( base . connectionTimeoutSeconds !== undefined ) {
927+ noTag . connectionTimeoutSeconds = base . connectionTimeoutSeconds ;
928+ }
911929 this . loginHistory . splice ( index , 1 , JSON . stringify ( noTag ) ) ;
912930 LocalStorage . set ( STORAGE_KEY_LOGIN_HISTORY , this . loginHistory ) ;
913931 if ( this . loginData ) {
0 commit comments