File tree 2 files changed +12
-8
lines changed
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) {
388
388
389
389
GuiControl . prototype . selectDefaultTabWhenConnected = function ( ) {
390
390
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 {
394
394
$ ( '#tabs ul.mode-connected .tab_setup a' ) . click ( ) ;
395
- return ;
396
395
}
397
- $ ( `#tabs ul.mode-connected .${ result . lastTab } a` ) . click ( ) ;
398
396
} ) ;
399
397
} ;
400
398
Original file line number Diff line number Diff line change @@ -219,9 +219,15 @@ function startProcess() {
219
219
// Tabs
220
220
$ ( "#tabs ul.mode-connected li" ) . click ( function ( ) {
221
221
// 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
+ }
225
231
} ) ;
226
232
227
233
if ( GUI . isCordova ( ) ) {
You can’t perform that action at this time.
0 commit comments