Feature : RTK compress

This commit is contained in:
decolua 2026-04-22 15:36:51 +07:00
parent e1a219dba6
commit 8de9aae90c
26 changed files with 1612 additions and 0 deletions

View file

@ -36,6 +36,7 @@ const DEFAULT_SETTINGS = {
outboundProxyUrl: "",
outboundNoProxy: "",
mitmRouterBaseUrl: DEFAULT_MITM_ROUTER_BASE,
rtkEnabled: false,
};
function cloneDefaultData() {

20
src/lib/rtk/initRtk.js Normal file
View file

@ -0,0 +1,20 @@
import { getSettings } from "@/lib/localDb";
import { setRtkEnabled } from "open-sse/rtk/flag.js";
let initialized = false;
export async function ensureRtkInitialized() {
if (initialized) return true;
try {
const settings = await getSettings();
setRtkEnabled(settings.rtkEnabled === true);
initialized = true;
} catch (error) {
console.error("[ServerInit] Error initializing RTK flag:", error);
}
return initialized;
}
ensureRtkInitialized().catch(console.log);
export default ensureRtkInitialized;