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));
|
||||
});
|
||||
|
||||
const startConnection = async () => {
|
||||
const startConnection = async (): Promise<void> => {
|
||||
await saveConnection();
|
||||
isConnecting.value = true;
|
||||
|
||||
if (localConnection.value.ask)
|
||||
isAsking.value = true;
|
||||
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;
|
||||
}
|
||||
};
|
||||
@@ -582,7 +582,7 @@ const continueTest = async (credentials: {user: string; password: string }) => {
|
||||
try {
|
||||
if (isConnecting.value) {
|
||||
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;
|
||||
}
|
||||
else {
|
||||
|
@@ -163,7 +163,8 @@ export const useConnectionsStore = defineStore('connections', {
|
||||
uid: connection.uid,
|
||||
client: connection.client,
|
||||
icon: conn.icon,
|
||||
name: conn.name
|
||||
name: conn.name,
|
||||
hasCustomIcon: conn.hasCustomIcon
|
||||
};
|
||||
}
|
||||
return conn;
|
||||
|
@@ -151,7 +151,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
||||
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
||||
? {
|
||||
...workspace,
|
||||
structure: [],
|
||||
structure: [] as WorkspaceStructure[],
|
||||
breadcrumbs: {},
|
||||
loadedSchemas: new Set(),
|
||||
database: connection.database,
|
||||
@@ -167,7 +167,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
||||
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
||||
? {
|
||||
...workspace,
|
||||
structure: [],
|
||||
structure: [] as WorkspaceStructure[],
|
||||
breadcrumbs: {},
|
||||
loadedSchemas: new Set(),
|
||||
connectionStatus: 'disconnected'
|
||||
@@ -187,7 +187,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
||||
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === connection.uid
|
||||
? {
|
||||
...workspace,
|
||||
structure: [],
|
||||
structure: [] as WorkspaceStructure[],
|
||||
breadcrumbs: {},
|
||||
loadedSchemas: new Set(),
|
||||
connectionStatus: 'failed'
|
||||
@@ -200,9 +200,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
||||
return reject(new Error('Connection aborted by user'));
|
||||
else {
|
||||
let clientCustomizations: Customizations;
|
||||
const { updateLastConnection } = connectionsStore;
|
||||
|
||||
updateLastConnection(connection.uid);
|
||||
connectionsStore.updateLastConnection(connection.uid);
|
||||
|
||||
switch (connection.client) {
|
||||
case 'mysql':
|
||||
@@ -418,7 +416,7 @@ export const useWorkspacesStore = defineStore('workspaces', {
|
||||
this.workspaces = (this.workspaces as Workspace[]).map(workspace => workspace.uid === uid
|
||||
? {
|
||||
...workspace,
|
||||
structure: [],
|
||||
structure: [] as WorkspaceStructure[],
|
||||
breadcrumbs: {},
|
||||
loadedSchemas: new Set(),
|
||||
connectionStatus: 'disconnected'
|
||||
|
Reference in New Issue
Block a user