diff --git a/packages/web/src/widgets/TabsPanel.svelte b/packages/web/src/widgets/TabsPanel.svelte
index ae109f5c9..2fd3732a2 100644
--- a/packages/web/src/widgets/TabsPanel.svelte
+++ b/packages/web/src/widgets/TabsPanel.svelte
@@ -181,7 +181,7 @@
const getContextMenu = tab => () => {
const { tabid, props, tabComponent } = tab;
- const { conid, database } = props || {};
+
return [
{
text: 'Close',
@@ -209,20 +209,27 @@
onClick: () => showModal(FavoriteModal, { savingTab: tab }),
},
],
+ ];
+ };
+
+ function getDatabaseContextMenu(tabs) {
+ const { tabid, props } = tabs[0];
+ const { conid, database } = props;
+
+ return [
conid &&
database && [
- { divider: true },
{
- text: `Close with same DB - ${database}`,
+ text: `Close tabs with DB ${database}`,
onClick: () => closeWithSameDb(tabid),
},
{
- text: `Close with other DB than ${database}`,
+ text: `Close tabs with other DB than ${database}`,
onClick: () => closeWithOtherDb(tabid),
},
],
];
- };
+ }
const handleSetDb = async props => {
const { conid, database } = props || {};
@@ -251,9 +258,14 @@
class="db-name"
class:selected={tabsByDb[dbKey][0].tabDbKey == currentDbKey}
on:click={() => handleSetDb(tabsByDb[dbKey][0].props)}
+ use:contextMenu={getDatabaseContextMenu(tabsByDb[dbKey])}
>