From cb6f744d6b8e456ba9ea139ff4a3cd66c8463c87 Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Tue, 17 Jun 2025 02:42:03 +0400 Subject: [PATCH] style: only show the select menu if both stable and nightly releases are available --- src/components/change-version-dialog.tsx | 62 ++++++++++++++---------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/src/components/change-version-dialog.tsx b/src/components/change-version-dialog.tsx index b23a856..3563385 100644 --- a/src/components/change-version-dialog.tsx +++ b/src/components/change-version-dialog.tsx @@ -14,6 +14,7 @@ import { } from "@/components/ui/dialog"; import { Label } from "@/components/ui/label"; import { useBrowserDownload } from "@/hooks/use-browser-download"; +import { getBrowserDisplayName } from "@/lib/browser-utils"; import type { BrowserProfile, BrowserReleaseTypes } from "@/types"; import { invoke } from "@tauri-apps/api/core"; import { useEffect, useState } from "react"; @@ -153,43 +154,52 @@ export function ChangeVersionDialog({
-
{profile.name}
+
{profile.name}
-
+
{profile.release_type} ({profile.version})
- {/* Release Type Selection */} -
- - {isLoadingReleaseTypes ? ( -
- Loading release types... -
- ) : ( - { - void handleDownload(); - }} - placeholder="Select release type..." - downloadedVersions={downloadedVersions} - /> - )} -
+ {/* Release Type Selection - only show if multiple release types are available */} + {!releaseTypes.stable || !releaseTypes.nightly ? ( + + + Only {profile.release_type} releases are available for{" "} + {getBrowserDisplayName(profile.browser)}. + + + ) : ( +
+ + {isLoadingReleaseTypes ? ( +
+ Loading release types... +
+ ) : ( + { + void handleDownload(); + }} + placeholder="Select release type..." + downloadedVersions={downloadedVersions} + /> + )} +
+ )} {/* Downgrade Warning */} {showDowngradeWarning && ( - + Stability Warning @@ -197,7 +207,7 @@ export function ChangeVersionDialog({ You are about to switch from stable to nightly releases. Nightly versions may be less stable and could contain bugs or incomplete features. -
+