refactor: show app version in settings

This commit is contained in:
zhom
2026-03-29 13:02:41 +04:00
parent 0102cb6c06
commit a3514df0d4
3 changed files with 61 additions and 1 deletions
+25
View File
@@ -124,6 +124,11 @@ export function SettingsDialog({
const [e2ePasswordConfirm, setE2ePasswordConfirm] = useState("");
const [e2eError, setE2eError] = useState("");
const [isSavingE2e, setIsSavingE2e] = useState(false);
const [systemInfo, setSystemInfo] = useState<{
app_version: string;
os: string;
arch: string;
} | null>(null);
const { t } = useTranslation();
const { setTheme } = useTheme();
@@ -226,6 +231,17 @@ export function SettingsDialog({
} catch {
setHasE2ePassword(false);
}
// Load system info
try {
const info = await invoke<{
app_version: string;
os: string;
arch: string;
}>("get_system_info");
setSystemInfo(info);
} catch {
setSystemInfo(null);
}
} catch (error) {
console.error("Failed to load settings:", error);
} finally {
@@ -1088,6 +1104,15 @@ export function SettingsDialog({
version information for all browsers.
</p>
</div>
{/* System Info */}
{systemInfo && (
<div className="pt-2 border-t">
<p className="text-xs text-muted-foreground font-mono whitespace-pre-line select-all">
{`Donut Browser ${systemInfo.app_version}\n${systemInfo.os} ${systemInfo.arch}`}
</p>
</div>
)}
</div>
<DialogFooter className="shrink-0">