mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 11:56:00 +00:00
fix
This commit is contained in:
@@ -80,6 +80,12 @@ export function TabControl({ children, activePageIndex = undefined, activePageLa
|
||||
}
|
||||
}, [activePageLabel]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (childrenArray.length > 0 && (value < 0 || value >= childrenArray.length)) {
|
||||
setValue(0);
|
||||
}
|
||||
});
|
||||
|
||||
const theme = useTheme();
|
||||
|
||||
// // cleanup closed tabs
|
||||
|
||||
@@ -142,11 +142,11 @@ export default function ToolBar({ toolbarPortalRef }) {
|
||||
))}
|
||||
<ToolbarDropDownButton icon="icon add" text="New">
|
||||
{config.runAsPortal == false && <DropDownMenuItem onClick={modalState.open}>Connection</DropDownMenuItem>}
|
||||
<DropDownMenuItem onClick={newQuery}>SQL query</DropDownMenuItem>
|
||||
{!!currentDatabase && <DropDownMenuItem onClick={newQueryDesign}>Query designer</DropDownMenuItem>}
|
||||
<DropDownMenuItem onClick={newFreeTable}>Free table editor</DropDownMenuItem>
|
||||
<DropDownMenuItem onClick={newMarkdown}>Markdown page</DropDownMenuItem>
|
||||
<DropDownMenuItem onClick={newShell}>JavaScript shell script</DropDownMenuItem>
|
||||
<DropDownMenuItem onClick={() => newQuery()}>SQL query</DropDownMenuItem>
|
||||
{!!currentDatabase && <DropDownMenuItem onClick={() => newQueryDesign()}>Query designer</DropDownMenuItem>}
|
||||
<DropDownMenuItem onClick={() => newFreeTable()}>Free table editor</DropDownMenuItem>
|
||||
<DropDownMenuItem onClick={() => newMarkdown()}>Markdown page</DropDownMenuItem>
|
||||
<DropDownMenuItem onClick={() => newShell()}>JavaScript shell script</DropDownMenuItem>
|
||||
</ToolbarDropDownButton>
|
||||
|
||||
<ToolbarButton onClick={showImport} icon="icon import">
|
||||
|
||||
Reference in New Issue
Block a user