mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 12:35:59 +00:00
SYNC: fixed connection for scripts
This commit is contained in:
committed by
Diflow
parent
a648f1ee67
commit
edf1632cab
@@ -616,16 +616,13 @@
|
||||
|
||||
export function toggleFixedConnection() {
|
||||
const frontMatter = getSqlFrontMatter($editorValue, yaml);
|
||||
const currentDatabase = getCurrentDatabase();
|
||||
setEditorData(
|
||||
setSqlFrontMatter(
|
||||
$editorValue,
|
||||
frontMatter?.connectionId &&
|
||||
frontMatter?.connectionId == currentDatabase?.connection?._id &&
|
||||
frontMatter?.databaseName == currentDatabase?.name
|
||||
frontMatter?.connectionId && frontMatter?.connectionId == conid && frontMatter?.databaseName == database
|
||||
? { ...frontMatter, connectionId: undefined, databaseName: undefined }
|
||||
: currentDatabase?.connection?._id
|
||||
? { ...frontMatter, connectionId: currentDatabase.connection._id, databaseName: currentDatabase.name }
|
||||
: conid
|
||||
? { ...frontMatter, connectionId: conid, databaseName: database }
|
||||
: { ...frontMatter, connectionId: undefined, databaseName: undefined },
|
||||
yaml
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user