mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 17:24:00 +00:00
better workflow for askUser, when closing window
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
import { closeCurrentModal, showModal } from './modalTools';
|
import { closeCurrentModal, showModal } from './modalTools';
|
||||||
import { callServerPing } from '../utility/connectionsPinger';
|
import { callServerPing } from '../utility/connectionsPinger';
|
||||||
import { getConnectionLabel } from 'dbgate-tools';
|
import { getConnectionLabel } from 'dbgate-tools';
|
||||||
|
import { openedConnections } from '../stores';
|
||||||
|
|
||||||
export let conid;
|
export let conid;
|
||||||
export let passwordMode;
|
export let passwordMode;
|
||||||
@@ -74,7 +75,11 @@
|
|||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
currentModalConid = null;
|
currentModalConid = null;
|
||||||
if (onCancel && !closedWithOk) onCancel();
|
|
||||||
|
if (!closedWithOk) {
|
||||||
|
if (onCancel) onCancel();
|
||||||
|
openedConnections.update(x => _.without(x, conid));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleCancelTest() {
|
function handleCancelTest() {
|
||||||
@@ -83,8 +88,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleSubmit(ev) {
|
async function handleSubmit(ev) {
|
||||||
if (onConnect) {
|
|
||||||
closedWithOk = true;
|
closedWithOk = true;
|
||||||
|
|
||||||
|
if (onConnect) {
|
||||||
onConnect({
|
onConnect({
|
||||||
...testedConnection,
|
...testedConnection,
|
||||||
user: usedPasswordMode == 'askUser' ? $values['user'] : testedConnection.user,
|
user: usedPasswordMode == 'askUser' ? $values['user'] : testedConnection.user,
|
||||||
|
|||||||
Reference in New Issue
Block a user