refactor(ui): keep locale bootstrap branch focused

This commit is contained in:
Pascal André
2026-03-19 21:21:00 +01:00
parent 57efe5def3
commit 8c0a82d3a8
4 changed files with 98 additions and 175 deletions

View File

@@ -2,30 +2,10 @@ import { createEffect, createSignal, type Accessor } from "solid-js"
import { messageStoreBus } from "../../../stores/message-v2/bus"
import { clearSessionRenderCache } from "../../message-block"
import { getLogger } from "../../../lib/logger"
import { runtimeEnv } from "../../../lib/runtime-env"
const log = getLogger("session")
function getSessionCacheLimit() {
if (runtimeEnv.platform === "mobile") {
return 2
}
if (runtimeEnv.host === "tauri") {
return 3
}
if (typeof navigator !== "undefined") {
const deviceMemory = (navigator as Navigator & { deviceMemory?: number }).deviceMemory
if (typeof deviceMemory === "number" && deviceMemory <= 4) {
return 3
}
}
return 5
}
const SESSION_CACHE_LIMIT = getSessionCacheLimit()
const SESSION_CACHE_LIMIT = 5
type SessionCacheOptions = {
instanceId: Accessor<string>