@@ -86,7 +86,7 @@ export class ServerManagerView {
8686 activeTab ?: ServerOrFunctionalTab ;
8787 tabs : ServerOrFunctionalTab [ ] ;
8888 functionalTabs : Map < TabPage , number > ;
89- tabIndex : number ;
89+ tabId : number ;
9090 presetOrgs : string [ ] ;
9191 preferenceView ?: PreferenceView ;
9292 constructor ( ) {
@@ -132,7 +132,7 @@ export class ServerManagerView {
132132 this . tabs = [ ] ;
133133 this . presetOrgs = [ ] ;
134134 this . functionalTabs = new Map ( ) ;
135- this . tabIndex = 0 ;
135+ this . tabId = 0 ;
136136 }
137137
138138 async init ( ) : Promise < void > {
@@ -375,22 +375,22 @@ export class ServerManagerView {
375375 }
376376
377377 initServer ( server : ServerConfig , index : number ) : ServerTab {
378- const tabIndex = this . getTabIndex ( ) ;
378+ const tabId = this . gettabId ( ) ;
379379 const tab : ServerTab = new ServerTab ( {
380380 role : "server" ,
381381 icon : DomainUtil . iconAsUrl ( server . icon ) ,
382382 label : server . alias ,
383383 $root : this . $tabsContainer ,
384384 onClick : this . activateLastTab . bind ( this , index ) ,
385385 index,
386- tabIndex ,
386+ tabId ,
387387 onHover : this . onHover . bind ( this , index ) ,
388388 onHoverOut : this . onHoverOut . bind ( this , index ) ,
389389 webview : WebView . create ( {
390390 $root : this . $webviewsContainer ,
391391 rootWebContents,
392392 index,
393- tabIndex ,
393+ tabId ,
394394 url : server . url ,
395395 role : "server" ,
396396 hasPermission : ( origin : string , permission : string ) =>
@@ -483,9 +483,9 @@ export class ServerManagerView {
483483 this . toggleDndButton ( dnd ) ;
484484 }
485485
486- getTabIndex ( ) : number {
487- const currentIndex = this . tabIndex ;
488- this . tabIndex ++ ;
486+ gettabId ( ) : number {
487+ const currentIndex = this . tabId ;
488+ this . tabId ++ ;
489489 return currentIndex ;
490490 }
491491
@@ -574,7 +574,7 @@ export class ServerManagerView {
574574 const index = this . tabs . length ;
575575 this . functionalTabs . set ( tabProperties . page , index ) ;
576576
577- const tabIndex = this . getTabIndex ( ) ;
577+ const tabId = this . gettabId ( ) ;
578578 const $view = await tabProperties . makeView ( ) ;
579579 this . $webviewsContainer . append ( $view ) ;
580580
@@ -586,7 +586,7 @@ export class ServerManagerView {
586586 page : tabProperties . page ,
587587 $root : this . $tabsContainer ,
588588 index,
589- tabIndex ,
589+ tabId ,
590590 onClick : this . activateTab . bind ( this , index ) ,
591591 onDestroy : async ( ) => {
592592 await this . destroyFunctionalTab ( tabProperties . page , index ) ;
@@ -824,8 +824,8 @@ export class ServerManagerView {
824824 }
825825 }
826826
827- async isLoggedIn ( tabIndex : number ) : Promise < boolean > {
828- const tab = this . tabs [ tabIndex ] ;
827+ async isLoggedIn ( tabId : number ) : Promise < boolean > {
828+ const tab = this . tabs [ tabId ] ;
829829 if ( ! ( tab instanceof ServerTab ) ) return false ;
830830 const webview = await tab . webview ;
831831 const url = webview . getWebContents ( ) . getURL ( ) ;
@@ -1133,7 +1133,7 @@ export class ServerManagerView {
11331133 ( await tab . webview ) . webContentsId === webviewId
11341134 ) {
11351135 const concurrentTab : HTMLButtonElement = document . querySelector (
1136- `div[data-tab-id="${ CSS . escape ( `${ tab . properties . tabIndex } ` ) } "]` ,
1136+ `div[data-tab-id="${ CSS . escape ( `${ tab . properties . tabId } ` ) } "]` ,
11371137 ) ! ;
11381138 concurrentTab . click ( ) ;
11391139 }
0 commit comments