new query on middle mouse click

This commit is contained in:
Jan Prochazka 2021-07-14 20:46:26 +02:00
parent fa733e2285
commit d2317ab908
2 changed files with 5 additions and 7 deletions

View File

@ -123,7 +123,7 @@
text: 'Connect',
onClick: handleConnect,
},
{ onClick: handleNewQuery, text: 'New query' },
{ onClick: handleNewQuery, text: 'New query', isNewQuery: true },
$openedConnections.includes(data._id) &&
data.status && {
text: 'Refresh',
@ -191,10 +191,8 @@
on:click
on:expand
on:middleclick={() => {
if (data.singleDatabase) {
getDatabaseMenuItems(data, data.defaultDatabase, $extensions, $currentDatabase)
.find(x => x.isNewQuery)
.onClick();
}
_.flattenDeep(getContextMenu())
.find(x => x.isNewQuery)
.onClick();
}}
/>

View File

@ -49,7 +49,7 @@
if (tab.props && tab.props.conid && tab.props.database) return tab.props.database;
if (tab.props && tab.props.conid) {
const connection = connectionList?.find(x => x._id == tab.props.conid);
if (connection) return getConnectionLabel(connection.displayName, { allowExplicitDatabase: false });
if (connection) return getConnectionLabel(connection, { allowExplicitDatabase: false });
return '???';
}
if (tab.props && tab.props.archiveFolder) return tab.props.archiveFolder;