| ... | @@ -179,11 +179,12 @@ function SidebarUpdateControl() { | ... | @@ -179,11 +179,12 @@ function SidebarUpdateControl() { |
| 179 | : showUpdateDetails | 179 | : showUpdateDetails |
| 180 | ? isDesktopUpdateButtonDisabled(state) | 180 | ? isDesktopUpdateButtonDisabled(state) |
| 181 | : !canCheckForUpdate(state); | 181 | : !canCheckForUpdate(state); |
| | 182 | const isInteractionDisabled = disabled || isActionPending; |
| 182 | | 183 | |
| 183 | const handleAction = useCallback(async () => { | 184 | const handleAction = useCallback(async () => { |
| 184 | const bridge = window.desktopBridge; | 185 | const bridge = window.desktopBridge; |
| 185 | if (!bridge || !state) return; | 186 | if (!bridge || !state) return; |
| 186 | if (disabled || isActionPending) return; | 187 | if (isInteractionDisabled) return; |
| 187 | | 188 | |
| 188 | setIsActionPending(true); | 189 | setIsActionPending(true); |
| 189 | | 190 | |
| ... | @@ -293,7 +294,7 @@ function SidebarUpdateControl() { | ... | @@ -293,7 +294,7 @@ function SidebarUpdateControl() { |
| 293 | ); | 294 | ); |
| 294 | }) | 295 | }) |
| 295 | .finally(() => setIsActionPending(false)); | 296 | .finally(() => setIsActionPending(false)); |
| 296 | }, [action, disabled, isActionPending, prefersReducedMotion, state]); | 297 | }, [action, isInteractionDisabled, prefersReducedMotion, state]); |
| 297 | | 298 | |
| 298 | const handleCheckAnimationIteration = useCallback(() => { | 299 | const handleCheckAnimationIteration = useCallback(() => { |
| 299 | setIsCheckAnimationLatched( | 300 | setIsCheckAnimationLatched( |
| ... | @@ -312,13 +313,20 @@ function SidebarUpdateControl() { | ... | @@ -312,13 +313,20 @@ function SidebarUpdateControl() { |
| 312 | <button | 313 | <button |
| 313 | type="button" | 314 | type="button" |
| 314 | aria-label={tooltip} | 315 | aria-label={tooltip} |
| 315 | aria-disabled={disabled || isActionPending || undefined} | 316 | aria-disabled={isInteractionDisabled || undefined} |
| 316 | disabled={disabled || isActionPending} | | |
| 317 | className={cn( | 317 | 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", |
| 319 | showUpdateIconState | 320 | showUpdateIconState |
| 320 | ? "bg-update-surface text-update-foreground enabled:hover:bg-update/12" | 321 | ? cn( |
| 321 | : "text-[var(--sidebar-icon-color)] enabled:hover:bg-sidebar-row-hover enabled:hover:text-sidebar-foreground", | 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 | ), |
| 322 | disabled && !showUpdateIconState && "opacity-60", | 330 | disabled && !showUpdateIconState && "opacity-60", |
| 323 | )} | 331 | )} |
| 324 | onClick={handleAction} | 332 | onClick={handleAction} |