From c8385c16f2362477ec17f158833134590876bddd Mon Sep 17 00:00:00 2001 From: dalew <91363952+dal1wg@users.noreply.github.com> Date: Tue, 16 Jun 2026 18:02:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(redis):=20redis=E5=91=BD=E4=BB=A4=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=8F=B0=E4=B8=8A=E4=B8=8B=E6=96=87=E9=9A=94=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/redis/RedisKeyBrowser.vue | 31 ++----------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/apps/desktop/src/components/redis/RedisKeyBrowser.vue b/apps/desktop/src/components/redis/RedisKeyBrowser.vue index dcfdc39776..f7995f7032 100644 --- a/apps/desktop/src/components/redis/RedisKeyBrowser.vue +++ b/apps/desktop/src/components/redis/RedisKeyBrowser.vue @@ -816,38 +816,13 @@ function resumeRedisBrowserBackgroundWork() { registerRedisDbFlushedListener(); } -async function loadPersistedRedisHistory() { - try { - const entries = await api.loadRedisHistory(200, 0); - if (entries.length === 0) return; - // Merge persisted entries into in-memory commandHistory (newest first, reversed for display order) - const persisted: RedisCommandHistoryEntry[] = entries.reverse().map((entry) => ({ - id: ++commandHistoryId, - prompt: `db${entry.database}>`, - command: entry.sql, - output: entry.details_json ? formatRedisCommandResult(JSON.parse(entry.details_json)) : entry.error || "", - error: !entry.success, - })); - commandHistory.value = [...persisted, ...commandHistory.value]; - scrollCommandTerminalToEnd(); - } catch { - // Silently ignore load errors — history is best-effort - } -} - -async function clearPersistedRedisHistory() { - try { - await api.clearRedisHistory(); - toast(t("redis.historyCleared")); - } catch { - // Silently ignore - } +async function clearInMemoryHistory() { + commandHistory.value = []; } onMounted(() => { resumeRedisBrowserBackgroundWork(); void loadKeys(); - void loadPersistedRedisHistory(); }); onActivated(resumeRedisBrowserBackgroundWork); @@ -976,7 +951,7 @@ defineExpose({ focusSearch }); {{ t("redis.pubsub") }} -