|
|
|
@ -229,19 +229,21 @@ export class TabProxy extends Plugin { |
|
|
|
|
}) |
|
|
|
|
formatPath.shift() |
|
|
|
|
if (formatPath.length > 0) { |
|
|
|
|
const duplicateTabName = this.loadedTabs.find(({ title }) => title === formatPath.join('/')).name |
|
|
|
|
const duplicateTabPath = duplicateTabName.split('/') |
|
|
|
|
const duplicateTabFormatPath = [...duplicateTabPath].reverse() |
|
|
|
|
const duplicateTabTitle = duplicateTabFormatPath.slice(0, titleLength).reverse().join('/') |
|
|
|
|
|
|
|
|
|
this.loadedTabs.push({ |
|
|
|
|
id: duplicateTabName, |
|
|
|
|
name: duplicateTabName, |
|
|
|
|
title: duplicateTabTitle, |
|
|
|
|
icon, |
|
|
|
|
tooltip: duplicateTabName, |
|
|
|
|
iconClass: helper.getPathIcon(duplicateTabName) |
|
|
|
|
}) |
|
|
|
|
const index = this.loadedTabs.findIndex(({ title }) => title === formatPath.join('/')) |
|
|
|
|
if (index > -1) { |
|
|
|
|
const duplicateTabName = this.loadedTabs[index].name |
|
|
|
|
const duplicateTabPath = duplicateTabName.split('/') |
|
|
|
|
const duplicateTabFormatPath = [...duplicateTabPath].reverse() |
|
|
|
|
const duplicateTabTitle = duplicateTabFormatPath.slice(0, titleLength).reverse().join('/') |
|
|
|
|
this.loadedTabs[index] = { |
|
|
|
|
id: duplicateTabName, |
|
|
|
|
name: duplicateTabName, |
|
|
|
|
title: duplicateTabTitle, |
|
|
|
|
icon, |
|
|
|
|
tooltip: duplicateTabName, |
|
|
|
|
iconClass: helper.getPathIcon(duplicateTabName) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|