Skip to content

Commit

Permalink
always sync schema
Browse files Browse the repository at this point in the history
  • Loading branch information
macjuul committed Jan 29, 2025
1 parent 55ebd0c commit f4c5017
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/screens/surrealist/connection/connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ export function cancelLiveQueries(tab: string) {
*/
export async function activateDatabase(namespace: string, database: string) {
const { updateCurrentConnection } = useConfigStore.getState();
let invalidNS = false;

// Select a namespace only
if (namespace) {
Expand All @@ -590,12 +591,12 @@ export async function activateDatabase(namespace: string, database: string) {
database: null,
});
} else {
invalidNS = true;

updateCurrentConnection({
lastNamespace: "",
lastDatabase: "",
});

return;
}
} else {
updateCurrentConnection({
Expand All @@ -605,7 +606,7 @@ export async function activateDatabase(namespace: string, database: string) {
}

// Select a database
if (namespace && database) {
if (!invalidNS && namespace && database) {
const isValid = await isDatabaseValid(database);

if (isValid) {
Expand Down

0 comments on commit f4c5017

Please sign in to comment.