Skip to content

Commit 1f95990

Browse files
authored
Fixed auto-select first project tab on conversion
Fixed auto-select first project tab on conversion
1 parent 910e160 commit 1f95990

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/bbmods/modelFormatMod.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,12 @@ ModelFormat.prototype.convertTo = function convertTo() {
174174
Project.saved = false
175175

176176
// Hacky method to refresh the top bar and make the custom tab menu appear without reopening the project
177+
let selectedProjTabIndex = 0;
178+
ModelProject.all.forEach(function (proj) {
179+
if(!proj.selected) selectedProjTabIndex++
180+
})
177181
Interface.tab_bar.openNewTab()
178-
ModelProject.all[0].select()
182+
ModelProject.all[selectedProjTabIndex].select()
179183
}
180184

181185
bus.on(EVENTS.LIFECYCLE.CLEANUP, () => {

0 commit comments

Comments
 (0)