mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: custom connection icon disappears during connection, fixes #939
This commit is contained in:
@@ -527,14 +527,14 @@ watch(() => props.connection, () => {
|
|||||||
localConnection.value = JSON.parse(JSON.stringify(props.connection));
|
localConnection.value = JSON.parse(JSON.stringify(props.connection));
|
||||||
});
|
});
|
||||||
|
|
||||||
const startConnection = async () => {
|
const startConnection = async (): Promise<void> => {
|
||||||
await saveConnection();
|
await saveConnection();
|
||||||
isConnecting.value = true;
|
isConnecting.value = true;
|
||||||
|
|
||||||
if (localConnection.value.ask)
|
if (localConnection.value.ask)
|
||||||
isAsking.value = true;
|
isAsking.value = true;
|
||||||
else {
|
else {
|
||||||
await connectWorkspace(localConnection.value, { signal: abortController.value.signal }).catch(() => undefined);
|
await connectWorkspace(localConnection.value, { signal: abortController.value.signal }).catch((): void => undefined);
|
||||||
isConnecting.value = false;
|
isConnecting.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -582,7 +582,7 @@ const continueTest = async (credentials: {user: string; password: string }) => {
|
|||||||
try {
|
try {
|
||||||
if (isConnecting.value) {
|
if (isConnecting.value) {
|
||||||
const params = Object.assign({}, props.connection, credentials);
|
const params = Object.assign({}, props.connection, credentials);
|
||||||
await connectWorkspace(params, { signal: abortController.value.signal }).catch(() => undefined);
|
await connectWorkspace(params, { signal: abortController.value.signal }).catch((): void => undefined);
|
||||||
isConnecting.value = false;
|
isConnecting.value = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@@ -163,7 +163,8 @@ export const useConnectionsStore = defineStore('connections', {
|
|||||||
uid: connection.uid,
|
uid: connection.uid,
|
||||||
client: connection.client,
|
client: connection.client,
|
||||||
icon: conn.icon,
|
icon: conn.icon,
|
||||||
name: conn.name
|
name: conn.name,
|
||||||
|
hasCustomIcon: conn.hasCustomIcon
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return conn;
|
return conn;
|
||||||
|
@@ -151,7 +151,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
|||||||
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
||||||
? {
|
? {
|
||||||
...workspace,
|
...workspace,
|
||||||
structure: [],
|
structure: [] as WorkspaceStructure[],
|
||||||
breadcrumbs: {},
|
breadcrumbs: {},
|
||||||
loadedSchemas: new Set(),
|
loadedSchemas: new Set(),
|
||||||
database: connection.database,
|
database: connection.database,
|
||||||
@@ -167,7 +167,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
|||||||
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
||||||
? {
|
? {
|
||||||
...workspace,
|
...workspace,
|
||||||
structure: [],
|
structure: [] as WorkspaceStructure[],
|
||||||
breadcrumbs: {},
|
breadcrumbs: {},
|
||||||
loadedSchemas: new Set(),
|
loadedSchemas: new Set(),
|
||||||
connectionStatus: 'disconnected'
|
connectionStatus: 'disconnected'
|
||||||
@@ -187,7 +187,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
|||||||
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
||||||
? {
|
? {
|
||||||
...workspace,
|
...workspace,
|
||||||
structure: [],
|
structure: [] as WorkspaceStructure[],
|
||||||
breadcrumbs: {},
|
breadcrumbs: {},
|
||||||
loadedSchemas: new Set(),
|
loadedSchemas: new Set(),
|
||||||
connectionStatus: 'failed'
|
connectionStatus: 'failed'
|
||||||
@@ -200,9 +200,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
|||||||
return reject(new Error('Connection aborted by user'));
|
return reject(new Error('Connection aborted by user'));
|
||||||
else {
|
else {
|
||||||
let clientCustomizations: Customizations;
|
let clientCustomizations: Customizations;
|
||||||
const { updateLastConnection } = connectionsStore;
|
connectionsStore.updateLastConnection(connection.uid);
|
||||||
|
|
||||||
updateLastConnection(connection.uid);
|
|
||||||
|
|
||||||
switch (connection.client) {
|
switch (connection.client) {
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
@@ -418,7 +416,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
|||||||
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === uid
|
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === uid
|
||||||
? {
|
? {
|
||||||
...workspace,
|
...workspace,
|
||||||
structure: [],
|
structure: [] as WorkspaceStructure[],
|
||||||
breadcrumbs: {},
|
breadcrumbs: {},
|
||||||
loadedSchemas: new Set(),
|
loadedSchemas: new Set(),
|
||||||
connectionStatus: 'disconnected'
|
connectionStatus: 'disconnected'
|
||||||
|
Reference in New Issue
Block a user