File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -388,13 +388,11 @@ GuiControl.prototype.content_ready = function (callback) {
388388
389389GuiControl . prototype . selectDefaultTabWhenConnected = function ( ) {
390390 ConfigStorage . get ( [ 'rememberLastTab' , 'lastTab' ] , function ( result ) {
391- if ( ! ( result . rememberLastTab
392- && ! ! result . lastTab
393- && result . lastTab . substring ( 4 ) !== "cli" ) ) {
391+ if ( result . rememberLastTab && result . lastTab ) {
392+ $ ( `#tabs ul.mode-connected . ${ result . lastTab } a` ) . click ( ) ;
393+ } else {
394394 $ ( '#tabs ul.mode-connected .tab_setup a' ) . click ( ) ;
395- return ;
396395 }
397- $ ( `#tabs ul.mode-connected .${ result . lastTab } a` ) . click ( ) ;
398396 } ) ;
399397} ;
400398
Original file line number Diff line number Diff line change @@ -219,9 +219,15 @@ function startProcess() {
219219 // Tabs
220220 $ ( "#tabs ul.mode-connected li" ) . click ( function ( ) {
221221 // store the first class of the current tab (omit things like ".active")
222- ConfigStorage . set (
223- { lastTab : $ ( this ) . attr ( "class" ) . split ( ' ' ) [ 0 ] }
224- ) ;
222+ const tabName = $ ( this ) . attr ( "class" ) . split ( ' ' ) [ 0 ] ;
223+
224+ const tabNameWithoutPrefix = tabName . substring ( 4 ) ;
225+ if ( tabNameWithoutPrefix !== "cli" ) {
226+ // Don't store 'cli' otherwise you can never connect to another tab.
227+ ConfigStorage . set (
228+ { lastTab : tabName } ,
229+ ) ;
230+ }
225231 } ) ;
226232
227233 if ( GUI . isCordova ( ) ) {
You can’t perform that action at this time.
0 commit comments