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