mirror of
https://github.com/dbgate/dbgate
synced 2024-09-19 21:02:03 +00:00
fixed scenario after save table
This commit is contained in:
parent
5f23b29c4e
commit
6c4679d83b
@ -39,7 +39,6 @@
|
||||
import _ from 'lodash';
|
||||
import registerCommand from '../commands/registerCommand';
|
||||
|
||||
|
||||
import { extensions } from '../stores';
|
||||
import useEditorData from '../query/useEditorData';
|
||||
import TableEditor from '../tableeditor/TableEditor.svelte';
|
||||
@ -56,6 +55,7 @@
|
||||
import ToolStripCommandButton from '../buttons/ToolStripCommandButton.svelte';
|
||||
import ToolStripButton from '../buttons/ToolStripButton.svelte';
|
||||
import hasPermission from '../utility/hasPermission';
|
||||
import { changeTab } from '../utility/common';
|
||||
|
||||
export let tabid;
|
||||
export let conid;
|
||||
@ -116,7 +116,16 @@
|
||||
} else {
|
||||
await apiCall('database-connections/sync-model', { conid, database });
|
||||
showSnackbarSuccess('Saved to database');
|
||||
const isCreateTable = $editorValue?.base == null;
|
||||
const tableName = _.pick($editorValue.current, ['pureName', 'schemaName']);
|
||||
clearEditorData();
|
||||
if (isCreateTable) {
|
||||
changeTab(tabid, tab => ({
|
||||
...tab,
|
||||
title: tableName.pureName,
|
||||
props: { ...tab.props, ...tableName },
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user