mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
Feature : RTK compress
This commit is contained in:
@@ -36,6 +36,7 @@ const DEFAULT_SETTINGS = {
|
||||
outboundProxyUrl: "",
|
||||
outboundNoProxy: "",
|
||||
mitmRouterBaseUrl: DEFAULT_MITM_ROUTER_BASE,
|
||||
rtkEnabled: false,
|
||||
};
|
||||
|
||||
function cloneDefaultData() {
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user