diff --git a/src/components/SettingsView.tsx b/src/components/SettingsView.tsx index 87fd767..ea003a4 100644 --- a/src/components/SettingsView.tsx +++ b/src/components/SettingsView.tsx @@ -8,7 +8,8 @@ import { } from '../store/useSettingsStore'; import { Download, Palette, Globe, Folder, Key, - Moon, Terminal, Puzzle, Info, Plus, Trash2, Copy, RefreshCw, Code, ShieldAlert, Check + Moon, Terminal, Puzzle, Info, Plus, Trash2, Copy, RefreshCw, Code, ShieldAlert, Check, + ExternalLink, BadgeCheck, AlertCircle } from 'lucide-react'; import { open } from '@tauri-apps/plugin-dialog'; import { getVersion } from '@tauri-apps/api/app'; @@ -62,6 +63,18 @@ const browserCookieSourceOptions = [ type EngineCheck = typeof engineChecks[number]; +const FIRELINK_SOURCE_URL = 'https://github.com/nimbold/Firelink'; +const FIRELINK_LICENSE_URL = 'https://github.com/nimbold/Firelink/blob/main/LICENSE'; +const FIRELINK_FIREFOX_ADDON_URL = 'https://addons.mozilla.org/en-US/firefox/addon/firelink-companion/'; +const FIRELINK_EXTENSION_RELEASES_URL = 'https://github.com/nimbold/Firelink-Extension/releases'; + +type ManualUpdateStatus = + | { type: 'idle' } + | { type: 'checking' } + | { type: 'up-to-date'; latestVersion: string; localVersion: string } + | { type: 'update-available'; version: string; releaseUrl: string } + | { type: 'error'; message: string }; + const engineStatusCache = new Map(); const engineStatusInFlight = new Map>(); @@ -268,6 +281,7 @@ const [extensionServerPort, setExtensionServerPort] = useState(nu // Toast notifications const { addToast } = useToast(); const [isCheckingForUpdates, setIsCheckingForUpdates] = useState(false); + const [manualUpdateStatus, setManualUpdateStatus] = useState({ type: 'idle' }); useEffect(() => { getVersion().then(setAppVersion).catch(() => undefined); @@ -341,6 +355,14 @@ runEngineChecks(false); addToast({ message: msg, variant }); }; + const openExternalUrl = async (url: string, label: string) => { + try { + await openUrl(url); + } catch (error) { + showToast(`Could not open ${label}: ${String(error)}`, 'error'); + } + }; + const findEngine = (kind: string) => engineStatus?.find(e => e.kind === kind) ?? null; const renderEngineStatus = (item: EngineStatusItem | null) => { @@ -391,37 +413,34 @@ runEngineChecks(false); if (isCheckingForUpdates) return; setIsCheckingForUpdates(true); - showToast('Checking for updates...'); + setManualUpdateStatus({ type: 'checking' }); try { const result = await invoke('check_for_updates'); if (result.type === 'UpToDate') { - showToast(`Firelink ${result.latest_version} is up to date`, 'success'); + setManualUpdateStatus({ + type: 'up-to-date', + latestVersion: result.latest_version, + localVersion: result.local_version + }); } else if (result.type === 'UpdateAvailable') { - addToast({ - variant: 'info', - isActionable: true, - message: ( -
- Firelink {result.update.version} is available. - -
- ) + setManualUpdateStatus({ + type: 'update-available', + version: result.update.version, + releaseUrl: result.update.release_url }); } else { - showToast('The update check returned an unexpected response', 'warning'); + setManualUpdateStatus({ + type: 'error', + message: 'The update check returned an unexpected response.' + }); } } catch (error) { - showToast(`Update check failed: ${String(error)}`, 'error'); + setManualUpdateStatus({ + type: 'error', + message: `Update check failed: ${String(error)}` + }); } finally { setIsCheckingForUpdates(false); } @@ -1225,20 +1244,22 @@ className="app-button px-3 py-1.5 text-[12px] flex items-center gap-1.5 disabled

Install the Firelink Companion extension on your browser.

- void openExternalUrl(FIRELINK_FIREFOX_ADDON_URL, 'Firefox Add-ons')} + className="w-full bg-item-hover hover:bg-item-hover/80 text-text-primary border border-border-modal font-medium py-1 px-2 rounded text-[11px] flex items-center justify-center gap-1 transition-colors" > Firefox Add-ons - - + +
@@ -1268,22 +1289,70 @@ className="app-button px-3 py-1.5 text-[12px] flex items-center gap-1.5 disabled {/* About Pane */} {activeTab === 'about' && (
- {/* Header Box */} -
- Firelink Icon -
-

Firelink

-

Version {appVersion}

-

- A fast desktop download manager powered by Rust and Tauri. -

+
+
+ Firelink Icon +
+

Firelink

+

Version {appVersion}

+

+ Cross-platform download manager for macOS, Windows, and Linux. +

+
+
- {/* Updates Section */} + {manualUpdateStatus.type !== 'idle' && manualUpdateStatus.type !== 'checking' && ( +
+
+ {manualUpdateStatus.type === 'up-to-date' ? ( + + ) : manualUpdateStatus.type === 'update-available' ? ( + + ) : ( + + )} + + {manualUpdateStatus.type === 'up-to-date' && + `Firelink ${manualUpdateStatus.latestVersion} is up to date.`} + {manualUpdateStatus.type === 'update-available' && + `Firelink ${manualUpdateStatus.version} is available.`} + {manualUpdateStatus.type === 'error' && manualUpdateStatus.message} + +
+ {manualUpdateStatus.type === 'update-available' && ( + + )} +
+ )} +

Updates

-
+

Check for Updates

@@ -1317,20 +1386,20 @@ className="app-button px-3 py-1.5 text-[12px] flex items-center gap-1.5 disabled
- {/* Credits Footer */} -
+
Created by NimBold - - Source Code - -
-
- Built with RustTauriReactTypeScript - MIT License +
- Download engines: aria2yt-dlpFFmpegDeno + Download engines: aria2, yt-dlp, FFmpeg, and Deno.
Copyright © 2026 NimBold. All rights reserved.