mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 22:26:01 +00:00
openNewTab refactor
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import _ from 'lodash';
|
||||
import { useSetOpenedTabs, useCurrentDatabase } from '../utility/globalState';
|
||||
import { openNewTab } from '../utility/common';
|
||||
import useOpenNewTab from '../utility/useOpenNewTab';
|
||||
|
||||
export default function useNewQuery() {
|
||||
const setOpenedTabs = useSetOpenedTabs();
|
||||
const openNewTab = useOpenNewTab();
|
||||
const currentDatabase = useCurrentDatabase();
|
||||
|
||||
const connection = _.get(currentDatabase, 'connection') || {};
|
||||
@@ -13,7 +13,6 @@ export default function useNewQuery() {
|
||||
|
||||
return ({ title = undefined, initialData = undefined, ...props } = {}) =>
|
||||
openNewTab(
|
||||
setOpenedTabs,
|
||||
{
|
||||
title: title || 'Query',
|
||||
icon: 'img sql-file',
|
||||
|
||||
Reference in New Issue
Block a user