Skip to content

Commit

Permalink
feat: postloader setting in dev settings because it gets annoying
Browse files Browse the repository at this point in the history
  • Loading branch information
byeoon committed Oct 24, 2024
1 parent b26d4b7 commit f9a99d2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/def.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ interface Settings {
debuggerUrl: string;
developerSettings: boolean;
crashLogs: boolean;
postLoader: boolean;
safeMode?: {
enabled: boolean;
currentThemeId?: string;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ 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: {
title: "Opti Post Loader",
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.");
}
},
Expand Down
1 change: 1 addition & 0 deletions src/ui/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>;

export const Alert = findByDisplayName("FluxContainer(Alert)");
Expand Down
10 changes: 9 additions & 1 deletion src/ui/settings/pages/Developer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function Developer() {

return (
<ErrorBoundary>
<RN.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 24, alignItems: "center" }}>
<RN.ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 20, alignItems: "center" }}>
<Stack spacing={16}>
<TableRowGroup title="Debug" titleStyleType="no_border">
<FormInput
Expand Down Expand Up @@ -191,6 +191,14 @@ export default function Developer() {
showToast("Does not work yet.");
}}
/>
<TableSwitchRow
label="Enable Post Loader"
icon={<TableRowIcon source={getAssetIDByName("ic_add_circle")} />}
value={settings.postLoader}
onValueChange={(v: boolean) => {
settings.postLoader = v;
}}
/>
</TableRowGroup>
<TableRowGroup title="Branch">

Expand Down

0 comments on commit f9a99d2

Please sign in to comment.