force new tab, if Open data from menu

This commit is contained in:
Jan Prochazka
2021-01-05 17:13:39 +01:00
parent 463b179a6b
commit 162874f383
2 changed files with 28 additions and 18 deletions

View File

@@ -11,7 +11,7 @@ export default function useOpenNewTab() {
const openedTabs = useOpenedTabs();
const openNewTab = React.useCallback(
async (newTab, initialData = undefined) => {
async (newTab, initialData = undefined, options) => {
let existing = null;
const { savedFile } = newTab.props || {};
@@ -22,8 +22,10 @@ export default function useOpenNewTab() {
);
}
const { forceNewTab } = options || {};
const component = tabs[newTab.tabComponent];
if (!existing && component && component.matchingProps) {
if (!existing && !forceNewTab && component && component.matchingProps) {
const testString = stableStringify(_.pick(newTab.props || {}, component.matchingProps));
existing = openedTabs.find(
(x) =>