From a6bdf69a281c8614c41274b6dc2f3563aa89c57e Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Sat, 3 Dec 2022 17:53:00 +0100 Subject: [PATCH] fix: connection default icon not change after client change --- src/renderer/stores/connections.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/renderer/stores/connections.ts b/src/renderer/stores/connections.ts index e6867701..2e888171 100644 --- a/src/renderer/stores/connections.ts +++ b/src/renderer/stores/connections.ts @@ -115,8 +115,25 @@ export const useConnectionsStore = defineStore('connections', { if (conn.uid === connection.uid) return connection; return conn; }); + this.connections = editedConnections; persistentStore.set('connections', this.connections); + + const editedConnectionsOrder = (this.connectionsOrder as SidebarElement[]).map(conn => { + if (conn.uid === connection.uid) { + return { + isFolder: false, + uid: connection.uid, + client: connection.client, + icon: conn.icon, + name: conn.name + }; + } + return conn; + }); + + this.connectionsOrder = editedConnectionsOrder; + persistentStore.set('connectionsOrder', this.connectionsOrder); }, updateConnections (connections: ConnectionParams[]) { this.connections = connections;