Make selected tab default when unknown value comes from localStorage

Change-Id: I80ff90242ac386e74a80d36f0656ff9e761fa147
This commit is contained in:
Gilles Dubuc 2014-07-29 11:56:32 -04:00
parent 53e965b469
commit ad1922988b

View file

@ -94,7 +94,13 @@
this.ooTabs.embed
] );
this.selectedTab = this.getLastUsedTab() || 'download';
this.selectedTab = this.getLastUsedTab();
// In case nothing is saved in localStorage or it contains junk
if ( ! this.tabs.hasOwnProperty( this.selectedTab ) ) {
this.selectedTab = 'download';
}
this.reuseTabs.selectItem( this.ooTabs[this.selectedTab] );
if ( this.dependenciesNeedToBeAttached ) {