fix(browser): ensure connection before mount loads
This commit is contained in:
1 parent
ded6e002b5
commit
8094f4901d
9 files changed
+89
-9
No files matched your search
@@ -255,6 +255,11 @@ watch(autoRefreshInterval, () => {
|
||||
// Lifecycle
|
||||
// ---------------------------------------------------------------------------
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await connectionStore.ensureConnected(props.connectionId);
|
||||
} catch (e) {
|
||||
console.warn("[DBX] ensureConnected failed for", props.connectionId, e);
|
||||
}
|
||||
await fetchClusterNodes();
|
||||
await fetchInfo();
|
||||
});
|
||||
|
||||
@@ -921,12 +921,29 @@ function onCommandInputKeydown(event: KeyboardEvent) {
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
resumeRedisBrowserBackgroundWork();
|
||||
try {
|
||||
await connectionStore.ensureConnected(props.connectionId);
|
||||
} catch (e) {
|
||||
console.warn("[DBX] ensureConnected failed for", props.connectionId, e);
|
||||
}
|
||||
void loadKeys();
|
||||
});
|
||||
|
||||
onActivated(resumeRedisBrowserBackgroundWork);
|
||||
onActivated(async () => {
|
||||
resumeRedisBrowserBackgroundWork();
|
||||
// Ensure the connection is still alive after reactivation (e.g. tab switch).
|
||||
// If keys failed to load previously (empty list), retry loading.
|
||||
try {
|
||||
await connectionStore.ensureConnected(props.connectionId);
|
||||
} catch (e) {
|
||||
console.warn("[DBX] ensureConnected failed for", props.connectionId, e);
|
||||
}
|
||||
if (flatKeys.value.length === 0 && !loading.value) {
|
||||
void loadKeys();
|
||||
}
|
||||
});
|
||||
|
||||
onDeactivated(pauseRedisBrowserBackgroundWork);
|
||||
|
||||
|
||||
@@ -59,9 +59,10 @@ const showClientColumns = computed(() => {
|
||||
onMounted(async () => {
|
||||
if (connectionMode.value === "cluster") {
|
||||
try {
|
||||
await connectionStore.ensureConnected(props.connectionId);
|
||||
nodes.value = await api.redisClusterMasterNodes(props.connectionId);
|
||||
} catch {
|
||||
// Silently fail — nodes list is best-effort
|
||||
} catch (e) {
|
||||
console.warn("[DBX] ensureConnected failed for", props.connectionId, e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user