ability to disable tab preview mode

This commit is contained in:
SPRINX0\prochazka
2024-12-17 09:34:16 +01:00
parent ca5dd0ac30
commit 7759fd862f
3 changed files with 26 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import localforage from 'localforage';
import stableStringify from 'json-stable-stringify';
import { saveAllPendingEditorData } from '../query/useEditorData';
import { getConnectionInfo } from './metadataLoaders';
import { getBoolSettingsValue } from '../settings/settingsTools';
function findFreeNumber(numbers: number[]) {
if (numbers.length == 0) return 1;
@@ -22,6 +23,13 @@ export default async function openNewTab(newTab, initialData: any = undefined, o
let existing = null;
if (!getBoolSettingsValue('behaviour.useTabPreviewMode', true) && newTab.tabPreviewMode) {
newTab = {
...newTab,
tabPreviewMode: false,
};
}
const { savedFile, savedFolder, savedFilePath, conid, database } = newTab.props || {};
if (conid && database) {