cloud connection save

This commit is contained in:
SPRINX0\prochazka
2025-05-26 16:46:04 +02:00
parent cc930a3ff9
commit afde0a7423
5 changed files with 83 additions and 29 deletions

View File

@@ -20,6 +20,7 @@
currentDatabase,
expandedConnections,
openedConnections,
openedSingleDatabaseConnections,
} from '../stores';
import _ from 'lodash';
import { plusExpandIcon } from '../icons/expandIcons';
@@ -74,12 +75,26 @@
};
}
onMount(() => {
const currentConid = $currentDatabase?.connection?._id;
if (currentConid?.startsWith('cloud://') && !$cloudConnectionsStore[currentConid]) {
loadCloudConnection(currentConid);
}
});
function ensureCloudConnectionsLoaded(...conids) {
_.uniq(conids).forEach(conid => {
if (conid?.startsWith('cloud://') && !$cloudConnectionsStore[conid]) {
loadCloudConnection(conid);
}
});
}
$: ensureCloudConnectionsLoaded(
$currentDatabase?.connection?._id,
...$openedSingleDatabaseConnections,
...$openedConnections
);
// onMount(() => {
// const currentConid = $currentDatabase?.connection?._id;
// if (currentConid?.startsWith('cloud://') && !$cloudConnectionsStore[currentConid]) {
// loadCloudConnection(currentConid);
// }
// });
function createAddMenu() {
return [