diff --git a/src/def.d.ts b/src/def.d.ts index 8c5d91cc..b417e794 100644 --- a/src/def.d.ts +++ b/src/def.d.ts @@ -154,6 +154,7 @@ interface Settings { debuggerUrl: string; developerSettings: boolean; crashLogs: boolean; + postLoader: boolean; safeMode?: { enabled: boolean; currentThemeId?: string; diff --git a/src/lib/security.ts b/src/lib/security.ts index da21eac7..fa378b38 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -9,7 +9,7 @@ const { Stack, TableRow, TableRowIcon, TableSwitchRow, TableRowGroup }= Tabs; export function initSplash() { const { showSimpleActionSheet } = findByProps("showSimpleActionSheet"); console.log("Loading Opti Security"); - if(window.vendetta.settings.developerSettings) { + if(window.vendetta.settings.developerSettings && window.vendetta.settings.postLoader) { showSimpleActionSheet({ key: "OptiPostload", header: { @@ -17,8 +17,8 @@ export function initSplash() { onClose: () => hideActionSheet(), }, options: [ - { label: "Toggle Safe Mode", onPress: (o : any) => { - window.vendetta.settings.safeMode === o; + { label: "Toggle Safe Mode", onPress: (o : boolean) => { + window.vendetta.settings.safeMode?.enabled == o; showToast("Loading Opti in safe mode."); } }, diff --git a/src/ui/components/index.ts b/src/ui/components/index.ts index 2d05bb3f..56d7fa92 100644 --- a/src/ui/components/index.ts +++ b/src/ui/components/index.ts @@ -15,6 +15,7 @@ export const Tabs = { ...findByProps("TableRow", "TableRowGroup"), RedesignSwitch: findSingular("FormSwitch"), RedesignCheckbox: findSingular("FormCheckbox"), + RedesignRadio: findSingular("FormRadio"), //idfk how to initialize this } as Record; export const Alert = findByDisplayName("FluxContainer(Alert)"); diff --git a/src/ui/settings/pages/Developer.tsx b/src/ui/settings/pages/Developer.tsx index 36f1f30d..9d0ceb6b 100644 --- a/src/ui/settings/pages/Developer.tsx +++ b/src/ui/settings/pages/Developer.tsx @@ -91,7 +91,7 @@ export default function Developer() { return ( - + + } + value={settings.postLoader} + onValueChange={(v: boolean) => { + settings.postLoader = v; + }} + />