diff --git a/packages/client/ui-open-in-app/src/client/OpenPathAction.tsx b/packages/client/ui-open-in-app/src/client/OpenPathAction.tsx index d6c7da7f7a..d7bf5aca23 100644 --- a/packages/client/ui-open-in-app/src/client/OpenPathAction.tsx +++ b/packages/client/ui-open-in-app/src/client/OpenPathAction.tsx @@ -58,7 +58,8 @@ export function FileOpenTarget(props: FileOpenTargetProps): ReactNode { return ( app.default)?.id} - failed={association?.path === props.absolutePath && apps === null} empty={props.empty === true} t={props.t} + loading={association?.path !== props.absolutePath} failed={association?.path === props.absolutePath && apps === null} + empty={props.empty === true} t={props.t} refresh={() => { setRevision(value => value + 1) }} execute={operation => props.openPath(props.absolutePath, operation.kind === 'reveal' ? 'reveal' : 'open', operation.kind === 'application' ? operation.id : undefined)} diff --git a/packages/client/ui-open-in-app/src/client/OpenTargetButton.tsx b/packages/client/ui-open-in-app/src/client/OpenTargetButton.tsx index b96675d8ae..207fee182f 100644 --- a/packages/client/ui-open-in-app/src/client/OpenTargetButton.tsx +++ b/packages/client/ui-open-in-app/src/client/OpenTargetButton.tsx @@ -26,6 +26,7 @@ export interface OpenTargetButtonProps { readonly applications: readonly OpenTargetApplication[] readonly defaultId: string | undefined readonly failed: boolean + readonly loading?: boolean readonly empty?: boolean readonly t: TranslateNS readonly execute: (operation: OpenTargetOperation) => Promise @@ -78,6 +79,7 @@ export function OpenTargetButton(props: OpenTargetButtonProps): ReactNode { const [menuOpen, setMenuOpen] = useState(false) const { pending, toast, act } = useOpenTargetGesture(props.execute, t) const preferred = applications.find(app => app.id === defaultId) + const disabled = pending || props.loading === true const revealDefault = kind === 'file' && preferred === undefined const primaryLabel = preferred === undefined ? t('path.reveal') : t('open.title', { app: preferred.name }) const run = (operation: OpenTargetOperation): void => { setMenuOpen(false); act(operation) } @@ -87,7 +89,7 @@ export function OpenTargetButton(props: OpenTargetButtonProps): ReactNode { : if (props.empty === true) return ( <> - {toast} @@ -97,7 +99,7 @@ export function OpenTargetButton(props: OpenTargetButtonProps): ReactNode { <> { run(id === 'reveal' ? { kind: 'reveal' } : { kind: 'application', id: id.slice(4) }) }} anchor={( -
+
-