Skip to content

Commit 1a1a52f

Browse files
committed
fix(desktop): keep patch notes visible while downloading
1 parent 09df91f commit 1a1a52f

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

‎apps/web/src/components/sidebar/SidebarUpdatePill.tsx‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,12 @@ function SidebarUpdateControl() {
179179
: showUpdateDetails
180180
? isDesktopUpdateButtonDisabled(state)
181181
: !canCheckForUpdate(state);
182+
const isInteractionDisabled = disabled || isActionPending;
182183

183184
const handleAction = useCallback(async () => {
184185
const bridge = window.desktopBridge;
185186
if (!bridge || !state) return;
186-
if (disabled || isActionPending) return;
187+
if (isInteractionDisabled) return;
187188

188189
setIsActionPending(true);
189190

@@ -293,7 +294,7 @@ function SidebarUpdateControl() {
293294
);
294295
})
295296
.finally(() => setIsActionPending(false));
296-
}, [action, disabled, isActionPending, prefersReducedMotion, state]);
297+
}, [action, isInteractionDisabled, prefersReducedMotion, state]);
297298

298299
const handleCheckAnimationIteration = useCallback(() => {
299300
setIsCheckAnimationLatched(
@@ -312,13 +313,20 @@ function SidebarUpdateControl() {
312313
<button
313314
type="button"
314315
aria-label={tooltip}
315-
aria-disabled={disabled || isActionPending || undefined}
316-
disabled={disabled || isActionPending}
316+
aria-disabled={isInteractionDisabled || undefined}
317317
className={cn(
318-
"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",
318+
"inline-flex size-8 items-center justify-center rounded-full outline-hidden ring-ring transition-colors focus-visible:ring-2",
319+
isInteractionDisabled ? "cursor-not-allowed" : "cursor-pointer",
319320
showUpdateIconState
320-
? "bg-update-surface text-update-foreground enabled:hover:bg-update/12"
321-
: "text-[var(--sidebar-icon-color)] enabled:hover:bg-sidebar-row-hover enabled:hover:text-sidebar-foreground",
321+
? cn(
322+
"bg-update-surface text-update-foreground",
323+
!isInteractionDisabled && "hover:bg-update/12",
324+
)
325+
: cn(
326+
"text-[var(--sidebar-icon-color)]",
327+
!isInteractionDisabled &&
328+
"hover:bg-sidebar-row-hover hover:text-sidebar-foreground",
329+
),
322330
disabled && !showUpdateIconState && "opacity-60",
323331
)}
324332
onClick={handleAction}

0 commit comments

Comments
 (0)