From a0dab0c9f6573265dbebc63dedf348b89c3f82a6 Mon Sep 17 00:00:00 2001 From: kmmiio99o Date: Wed, 1 Oct 2025 19:48:03 +0200 Subject: [PATCH] EXPLODO --- plugins/Commands/settings.tsx | 77 ++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 28 deletions(-) diff --git a/plugins/Commands/settings.tsx b/plugins/Commands/settings.tsx index 58432db..9b483ab 100644 --- a/plugins/Commands/settings.tsx +++ b/plugins/Commands/settings.tsx @@ -127,7 +127,7 @@ function Header() { ); } -// Facts Commands Settings Page - Fixed with nexpid's approach +// Facts Commands Settings Page function FactsSettingsPage() { useProxy(storage); @@ -147,14 +147,18 @@ function FactsSettingsPage() { subLabel="Send facts as a reply to the command message" leading={} value={storage.factSettings?.sendAsReply ?? true} - onValueChange={() => (storage.factSettings.sendAsReply = !storage.factSettings.sendAsReply)} + onValueChange={() => { + storage.factSettings.sendAsReply = !storage.factSettings.sendAsReply; + }} /> } value={storage.factSettings?.includeCitation ?? false} - onValueChange={() => (storage.factSettings.includeCitation = !storage.factSettings.includeCitation)} + onValueChange={() => { + storage.factSettings.includeCitation = !storage.factSettings.includeCitation; + }} /> @@ -195,7 +199,7 @@ function FactsSettingsPage() { ); } -// Gary API Settings Page - Fixed with nexpid's approach +// Gary API Settings Page with proper reactivity function GaryAPIPage() { useProxy(storage); @@ -399,7 +403,7 @@ function GaryAPIPage() { ); } -// List Commands Settings Page - Fixed with nexpid's approach +// List Commands Settings Page function ListSettingsPage() { useProxy(storage); @@ -419,14 +423,18 @@ function ListSettingsPage() { subLabel="Always use detailed mode when listing plugins" leading={} value={storage.listSettings?.pluginListAlwaysDetailed ?? false} - onValueChange={() => (storage.listSettings.pluginListAlwaysDetailed = !storage.listSettings.pluginListAlwaysDetailed)} + onValueChange={() => { + storage.listSettings.pluginListAlwaysDetailed = !storage.listSettings.pluginListAlwaysDetailed; + }} /> } value={storage.listSettings?.themeListAlwaysDetailed ?? false} - onValueChange={() => (storage.listSettings.themeListAlwaysDetailed = !storage.listSettings.themeListAlwaysDetailed)} + onValueChange={() => { + storage.listSettings.themeListAlwaysDetailed = !storage.listSettings.themeListAlwaysDetailed; + }} /> @@ -457,7 +465,7 @@ function ListSettingsPage() { ); } -// Image Commands Settings Page - Fixed with nexpid's approach +// Image Commands Settings Page function ImageSettingsPage() { useProxy(storage); @@ -511,7 +519,7 @@ function ImageSettingsPage() { ); } -// Spotify Commands Settings Page - Fixed with nexpid's approach +// Spotify Commands Settings Page function SpotifySettingsPage() { useProxy(storage); @@ -584,7 +592,7 @@ function SpotifySettingsPage() { ); } -// Other Commands Settings Page - Fixed with nexpid's approach +// Other Commands Settings Page function OtherSettingsPage() { useProxy(storage); @@ -628,7 +636,7 @@ function OtherSettingsPage() { ); } -// UPDATED Credits Page with requested changes +// FIXED Credits Page - changed "contributor" to "developer" function CreditsPage() { const styles = stylesheet.createThemedStyleSheet({ container: { @@ -753,7 +761,7 @@ function CreditsPage() { Thanks to this developers for creating such a nice plugins!{'\n'} - Tap on any contributor to visit their GitHub profile. + Tap on any developer to visit their GitHub profile. @@ -832,10 +840,9 @@ if (!storage.pendingRestart) { storage.pendingRestart = false; } -// Main Settings Component - Fixed with nexpid's approach +// Main Settings Component - COMPLETELY FIXED export default function Settings() { useProxy(storage); - const [rerender, forceRerender] = React.useReducer((x) => x + 1, 0); const navigation = NavigationNative.useNavigation(); const styles = stylesheet.createThemedStyleSheet({ @@ -861,13 +868,6 @@ export default function Settings() { }; }, []); - const navigateToPage = (title: string, component: React.ComponentType) => { - navigation.push("VendettaCustomPage", { - title, - render: component, - }); - }; - return ( } trailing={} - onPress={() => navigateToPage("Facts Commands", FactsSettingsPage)} + onPress={() => navigation.push("VendettaCustomPage", { + title: "Facts Commands", + render: FactsSettingsPage, + })} /> } trailing={} - onPress={() => navigateToPage("List Commands", ListSettingsPage)} + onPress={() => navigation.push("VendettaCustomPage", { + title: "List Commands", + render: ListSettingsPage, + })} /> } trailing={} - onPress={() => navigateToPage("Image Commands", ImageSettingsPage)} + onPress={() => navigation.push("VendettaCustomPage", { + title: "Image Commands", + render: ImageSettingsPage, + })} /> } trailing={} - onPress={() => navigateToPage("Gary Commands", GaryAPIPage)} + onPress={() => navigation.push("VendettaCustomPage", { + title: "Gary Commands", + render: GaryAPIPage, + })} /> } trailing={} - onPress={() => navigateToPage("Spotify Commands", SpotifySettingsPage)} + onPress={() => navigation.push("VendettaCustomPage", { + title: "Spotify Commands", + render: SpotifySettingsPage, + })} /> } trailing={} - onPress={() => navigateToPage("Other Commands", OtherSettingsPage)} + onPress={() => navigation.push("VendettaCustomPage", { + title: "Other Commands", + render: OtherSettingsPage, + })} /> @@ -933,7 +951,10 @@ export default function Settings() { subLabel="View original authors of the plugins" leading={} trailing={} - onPress={() => navigateToPage("Credits", CreditsPage)} + onPress={() => navigation.push("VendettaCustomPage", { + title: "Credits", + render: CreditsPage, + })} />