From f32c8760d15bf4713b3f9af1384219a44322febd Mon Sep 17 00:00:00 2001 From: xXJsonDeruloXx Date: Tue, 21 Oct 2025 21:45:14 -0400 Subject: rm old comments --- src/components/Content.tsx | 14 -------------- src/components/SmartClipboardButton.tsx | 7 +------ src/config/configSchema.ts | 4 ---- src/hooks/useLsfgHooks.ts | 3 +-- src/index.tsx | 6 ------ src/utils/clipboardUtils.ts | 6 ------ 6 files changed, 2 insertions(+), 38 deletions(-) (limited to 'src') diff --git a/src/components/Content.tsx b/src/components/Content.tsx index 28eefa7..3dc2696 100644 --- a/src/components/Content.tsx +++ b/src/components/Content.tsx @@ -39,25 +39,20 @@ export function Content() { const { isInstalling, isUninstalling, handleInstall, handleUninstall } = useInstallationActions(); - // Reload config when installation status changes useEffect(() => { if (isInstalled) { loadLsfgConfig(); } }, [isInstalled, loadLsfgConfig]); - // Generic configuration change handler const handleConfigChange = async (fieldName: keyof ConfigurationData, value: boolean | number | string) => { - // If we have a current profile, update that profile specifically if (currentProfile) { const newConfig = { ...config, [fieldName]: value }; const result = await updateProfileConfig(currentProfile, newConfig); if (result.success) { - // Reload config to reflect the changes from the backend await loadLsfgConfig(); } } else { - // Fallback to the original method for backward compatibility await updateField(fieldName, value); } }; @@ -80,7 +75,6 @@ export function Content() { return ( - {/* Show installation components at top when not fully installed */} {!isInstalled && ( <> )} - {/* FPS multiplier controls stay above profile selection when installed */} {isInstalled && ( <> @@ -126,7 +119,6 @@ export function Content() { )} - {/* Profile Management - only show if installed */} {isInstalled && ( )} - {/* Configuration Section - only show if installed */} {isInstalled && ( )} - {/* Clipboard buttons sit beside usage info for quick access */} {isInstalled && ( <> @@ -153,10 +143,8 @@ export function Content() { )} - {/* Usage instructions - always visible for user guidance */} - {/* Nerd Stuff Button */} - {/* Flatpaks Button */} - {/* Status and uninstall sit at bottom when installed to match desired layout */} {isInstalled && ( <> { if (showSuccess) { const timer = setTimeout(() => { @@ -38,10 +37,8 @@ export function SmartClipboardButton() { const { success, verified } = await copyWithVerification(text); if (success) { - // Show success feedback in the button instead of toast setShowSuccess(true); if (!verified) { - // Copy worked but verification failed - still show success console.log('Copy verification failed but copy likely worked'); } } else { @@ -64,9 +61,7 @@ export function SmartClipboardButton() { >
{showSuccess ? ( - + ) : isLoading ? ( ("get_configuration"); private resetConfiguration = callable<[], { success: boolean; data?: ConfigurationData; error?: string }>("reset_configuration"); @@ -131,5 +128,4 @@ export class ConfigurationManager { } } -// Export singleton instance export const configManager = ConfigurationManager.getInstance(); diff --git a/src/hooks/useLsfgHooks.ts b/src/hooks/useLsfgHooks.ts index e5dea63..adc18ba 100644 --- a/src/hooks/useLsfgHooks.ts +++ b/src/hooks/useLsfgHooks.ts @@ -71,7 +71,6 @@ export function useDllDetection() { } export function useLsfgConfig() { - // Use centralized configuration for initial state const [config, setConfig] = useState(() => ConfigurationManager.getDefaults()); const loadLsfgConfig = useCallback(async () => { @@ -114,7 +113,7 @@ export function useLsfgConfig() { useEffect(() => { loadLsfgConfig(); - }, []); // Empty dependency array to prevent infinite loop + }, []); return { config, diff --git a/src/index.tsx b/src/index.tsx index bbe4cd3..36945ba 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -7,17 +7,11 @@ export default definePlugin(() => { console.log("decky-lsfg-vk plugin initializing"); return { - // The name shown in various decky menus name: "Decky LSFG-VK", - // The element displayed at the top of your plugin's menu titleView:
Decky LSFG-VK
, - // Always render to retain state when panel is toggled alwaysRender: true, - // The content of your plugin's menu content: , - // The icon displayed in the plugin list icon: , - // The function triggered when your plugin unloads onDismount() { console.log("decky-lsfg-vk unloading"); } diff --git a/src/utils/clipboardUtils.ts b/src/utils/clipboardUtils.ts index 2d480fc..8a04caa 100644 --- a/src/utils/clipboardUtils.ts +++ b/src/utils/clipboardUtils.ts @@ -7,7 +7,6 @@ * This is especially important in gaming mode where clipboard APIs may behave differently */ export async function copyToClipboard(text: string): Promise { - // Use the proven input simulation method const tempInput = document.createElement('input'); tempInput.value = text; tempInput.style.position = 'absolute'; @@ -15,18 +14,15 @@ export async function copyToClipboard(text: string): Promise { document.body.appendChild(tempInput); try { - // Focus and select the text tempInput.focus(); tempInput.select(); - // Try copying using execCommand first (most reliable in gaming mode) let copySuccess = false; try { if (document.execCommand('copy')) { copySuccess = true; } } catch (e) { - // If execCommand fails, try navigator.clipboard as fallback try { await navigator.clipboard.writeText(text); copySuccess = true; @@ -37,7 +33,6 @@ export async function copyToClipboard(text: string): Promise { return copySuccess; } finally { - // Clean up document.body.removeChild(tempInput); } } @@ -50,7 +45,6 @@ export async function verifyCopy(expectedText: string): Promise { const readBack = await navigator.clipboard.readText(); return readBack === expectedText; } catch (e) { - // Verification not available, assume success return true; } } -- cgit v1.2.3