fix(desktop): keep release notes visible while downloading (#6412)
This commit is contained in:
1 parent
69e5ad8846
commit
b4be33f074
1 file changed
+15
-7
@@ -179,11 +179,12 @@ function SidebarUpdateControl() {
|
||||
: showUpdateDetails
|
||||
? isDesktopUpdateButtonDisabled(state)
|
||||
: !canCheckForUpdate(state);
|
||||
const isInteractionDisabled = disabled || isActionPending;
|
||||
|
||||
const handleAction = useCallback(async () => {
|
||||
const bridge = window.desktopBridge;
|
||||
if (!bridge || !state) return;
|
||||
if (disabled || isActionPending) return;
|
||||
if (isInteractionDisabled) return;
|
||||
|
||||
setIsActionPending(true);
|
||||
|
||||
@@ -293,7 +294,7 @@ function SidebarUpdateControl() {
|
||||
);
|
||||
})
|
||||
.finally(() => setIsActionPending(false));
|
||||
}, [action, disabled, isActionPending, prefersReducedMotion, state]);
|
||||
}, [action, isInteractionDisabled, prefersReducedMotion, state]);
|
||||
|
||||
const handleCheckAnimationIteration = useCallback(() => {
|
||||
setIsCheckAnimationLatched(
|
||||
@@ -312,13 +313,20 @@ function SidebarUpdateControl() {
|
||||
<button
|
||||
type="button"
|
||||
aria-label={tooltip}
|
||||
aria-disabled={disabled || isActionPending || undefined}
|
||||
disabled={disabled || isActionPending}
|
||||
aria-disabled={isInteractionDisabled || undefined}
|
||||
className={cn(
|
||||
"inline-flex size-8 items-center justify-center rounded-full outline-hidden ring-ring transition-colors enabled:cursor-pointer focus-visible:ring-2 disabled:cursor-not-allowed",
|
||||
"inline-flex size-8 items-center justify-center rounded-full outline-hidden ring-ring transition-colors focus-visible:ring-2",
|
||||
isInteractionDisabled ? "cursor-not-allowed" : "cursor-pointer",
|
||||
showUpdateIconState
|
||||
? "bg-update-surface text-update-foreground enabled:hover:bg-update/12"
|
||||
: "text-[var(--sidebar-icon-color)] enabled:hover:bg-sidebar-row-hover enabled:hover:text-sidebar-foreground",
|
||||
? cn(
|
||||
"bg-update-surface text-update-foreground",
|
||||
!isInteractionDisabled && "hover:bg-update/12",
|
||||
)
|
||||
: cn(
|
||||
"text-[var(--sidebar-icon-color)]",
|
||||
!isInteractionDisabled &&
|
||||
"hover:bg-sidebar-row-hover hover:text-sidebar-foreground",
|
||||
),
|
||||
disabled && !showUpdateIconState && "opacity-60",
|
||||
)}
|
||||
onClick={handleAction}
|
||||
|
||||
Reference in new issue
Block a user