diff --git a/plugins/Commands/settings.tsx b/plugins/Commands/settings.tsx index fff1397..9b74137 100644 --- a/plugins/Commands/settings.tsx +++ b/plugins/Commands/settings.tsx @@ -202,8 +202,10 @@ function FactsSettingsPage({ forceRerender }: { forceRerender: () => void }) { ); } -// Gary API Settings Page +// Gary API Settings Page - FIXED VERSION function GaryAPIPage({ forceRerender }: { forceRerender: () => void }) { + useProxy(storage); // Add this to make the component reactive to storage changes + const styles = stylesheet.createThemedStyleSheet({ container: { flex: 1, @@ -253,16 +255,13 @@ function GaryAPIPage({ forceRerender }: { forceRerender: () => void }) { optionTitle: { fontSize: 16, fontWeight: "600", - color: semanticColors.TEXT_NORMAL, + color: semanticColors.TEXT_NORMAL, // Fixed: always use TEXT_NORMAL }, optionDesc: { fontSize: 14, color: semanticColors.TEXT_MUTED, marginTop: 2, }, - selectedText: { - color: semanticColors.BRAND_500, - }, infoText: { fontSize: 14, color: semanticColors.TEXT_MUTED, @@ -339,8 +338,9 @@ function GaryAPIPage({ forceRerender }: { forceRerender: () => void }) { isSelected ? styles.selectedOption : styles.normalOption, ]} onPress={() => { - console.log(`[Settings] Changing Gary API to: ${option.value}`); + console.log(`[Settings] Changing Gary API from ${currentSource} to: ${option.value}`); storage.garySettings.imageSource = option.value; + // Force immediate update forceRerender(); }} > @@ -360,10 +360,7 @@ function GaryAPIPage({ forceRerender }: { forceRerender: () => void }) { }} /> - + {option.title} @@ -508,8 +505,8 @@ function ImageSettingsPage({ forceRerender }: { forceRerender: () => void }) { ); } -// Other Commands Settings Page -function OtherSettingsPage({ forceRerender }: { forceRerender: () => void }) { +// NEW: Separate Spotify Commands Settings Page +function SpotifySettingsPage({ forceRerender }: { forceRerender: () => void }) { const styles = stylesheet.createThemedStyleSheet({ container: { flex: 1, @@ -520,34 +517,6 @@ function OtherSettingsPage({ forceRerender }: { forceRerender: () => void }) { return ( - - } - value={storage.enabledCommands?.firstmessage ?? true} - onValueChange={(v) => { - storage.enabledCommands.firstmessage = v; - storage.pendingRestart = true; - forceRerender(); - }} - /> - - - - } - value={storage.enabledCommands?.sysinfo ?? true} - onValueChange={(v) => { - storage.enabledCommands.sysinfo = v; - storage.pendingRestart = true; - forceRerender(); - }} - /> - - void }) { }} /> + + + + These commands allow you to share your current Spotify activity in Discord. Make sure you have Spotify connected to Discord for these commands to work properly. + + + + + ); +} + +// Other Commands Settings Page - UPDATED (removed Spotify) +function OtherSettingsPage({ forceRerender }: { forceRerender: () => void }) { + const styles = stylesheet.createThemedStyleSheet({ + container: { + flex: 1, + backgroundColor: semanticColors.BACKGROUND_PRIMARY, + }, + }); + + return ( + + + + } + value={storage.enabledCommands?.firstmessage ?? true} + onValueChange={(v) => { + storage.enabledCommands.firstmessage = v; + storage.pendingRestart = true; + forceRerender(); + }} + /> + + + + } + value={storage.enabledCommands?.sysinfo ?? true} + onValueChange={(v) => { + storage.enabledCommands.sysinfo = v; + storage.pendingRestart = true; + forceRerender(); + }} + /> + ); @@ -818,9 +842,16 @@ export default function Settings() { trailing={} onPress={() => navigateToPage("Gary Commands", GaryAPIPage)} /> + } + trailing={} + onPress={() => navigateToPage("Spotify Commands", SpotifySettingsPage)} + /> } trailing={} onPress={() => navigateToPage("Other Commands", OtherSettingsPage)}