diff --git a/packages/web/src/stores.ts b/packages/web/src/stores.ts index 43e0ef39..d9c0ca11 100644 --- a/packages/web/src/stores.ts +++ b/packages/web/src/stores.ts @@ -187,6 +187,10 @@ export const getPinnedDatabases = () => _.compact(pinnedDatabasesValue); let currentDatabaseValue = null; currentDatabase.subscribe(value => { currentDatabaseValue = value; + if (value?.connection?._id) { + openedConnections.update(x => _.uniq([...x, value?.connection?._id])); + expandedConnections.update(x => _.uniq([...x, value?.connection?._id])); + } invalidateCommands(); }); export const getCurrentDatabase = () => currentDatabaseValue;