renamed singleDatabaseMode to lockedDatabaseMode

This commit is contained in:
Jan Prochazka
2022-12-25 17:32:14 +01:00
parent 3792f1001e
commit a6fa116b5e
6 changed files with 26 additions and 26 deletions

View File

@@ -1,11 +1,11 @@
<script lang="ts" context="module">
const getCurrentValueMarker: any = {};
export function shouldShowTab(tab, singleDbMode = getCurrentValueMarker, currentDb = getCurrentValueMarker) {
if (singleDbMode == getCurrentValueMarker) {
singleDbMode = getSingleDatabaseMode();
export function shouldShowTab(tab, lockedDbMode = getCurrentValueMarker, currentDb = getCurrentValueMarker) {
if (lockedDbMode == getCurrentValueMarker) {
lockedDbMode = getLockedDatabaseMode();
}
if (singleDbMode) {
if (lockedDbMode) {
if (currentDb == getCurrentValueMarker) {
currentDb = getCurrentDatabase();
}
@@ -250,8 +250,8 @@
activeTabId,
getActiveTabId,
getCurrentDatabase,
singleDatabaseMode,
getSingleDatabaseMode,
lockedDatabaseMode,
getLockedDatabaseMode,
} from '../stores';
import tabs from '../tabs';
import { setSelectedTab } from '../utility/common';
@@ -264,7 +264,7 @@
import TabCloseButton from '../elements/TabCloseButton.svelte';
import CloseTabModal from '../modals/CloseTabModal.svelte';
$: showTabFilterFunc = tab => shouldShowTab(tab, $singleDatabaseMode, $currentDatabase);
$: showTabFilterFunc = tab => shouldShowTab(tab, $lockedDatabaseMode, $currentDatabase);
$: connectionList = useConnectionList();
$: currentDbKey =
@@ -443,7 +443,7 @@
<div class="tabs" on:wheel={handleTabsWheel} bind:this={domTabs}>
{#each groupedTabs as tabGroup}
<div class="db-wrapper">
{#if !$singleDatabaseMode}
{#if !$lockedDatabaseMode}
<div
class="db-name"
class:selected={draggingDbGroup

View File

@@ -7,7 +7,7 @@
visibleSelectedWidget,
visibleWidgetSideBar,
visibleHamburgerMenuWidget,
singleDatabaseMode,
lockedDatabaseMode,
} from '../stores';
import mainMenuDefinition from '../../../../app/src/mainMenuDefinition';
import hasPermission from '../utility/hasPermission';
@@ -112,12 +112,12 @@
<div
class="wrapper"
title={`Toggle whether tabs from all databases are visible. Currently - ${$singleDatabaseMode ? 'NO' : 'YES'}`}
title={`Toggle whether tabs from all databases are visible. Currently - ${$lockedDatabaseMode ? 'NO' : 'YES'}`}
on:click={() => {
$singleDatabaseMode = !$singleDatabaseMode;
$lockedDatabaseMode = !$lockedDatabaseMode;
}}
>
<FontIcon icon={$singleDatabaseMode ? 'icon single-database-mode' : 'icon multi-database-mode'} />
<FontIcon icon={$lockedDatabaseMode ? 'icon locked-database-mode' : 'icon unlocked-database-mode'} />
</div>
<div class="wrapper" on:click={handleSettingsMenu} bind:this={domSettings}>
<FontIcon icon="icon settings" />