Hide import pill once the draft is submitting
This commit is contained in:
@@ -323,6 +323,16 @@ interface WorkspaceDraftAgentTabProps {
|
|||||||
onOpenImportSheet?: () => void;
|
onOpenImportSheet?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resolveImportPillPress(
|
||||||
|
onOpenImportSheet: (() => void) | undefined,
|
||||||
|
isSubmitting: boolean,
|
||||||
|
): (() => void) | null {
|
||||||
|
if (isSubmitting) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return onOpenImportSheet ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
export function WorkspaceDraftAgentTab({
|
export function WorkspaceDraftAgentTab({
|
||||||
serverId,
|
serverId,
|
||||||
workspaceId,
|
workspaceId,
|
||||||
@@ -588,6 +598,7 @@ export function WorkspaceDraftAgentTab({
|
|||||||
const handleDropdownCloseFocus = useCallback(() => {
|
const handleDropdownCloseFocus = useCallback(() => {
|
||||||
focusInputRef.current?.();
|
focusInputRef.current?.();
|
||||||
}, []);
|
}, []);
|
||||||
|
const importPillPress = resolveImportPillPress(onOpenImportSheet, isSubmitting);
|
||||||
const composerStatusControls = useMemo(
|
const composerStatusControls = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
...composerState.statusControls,
|
...composerState.statusControls,
|
||||||
@@ -645,10 +656,10 @@ export function WorkspaceDraftAgentTab({
|
|||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={inputAreaWrapperStyle}>
|
<View style={inputAreaWrapperStyle}>
|
||||||
{onOpenImportSheet ? (
|
{importPillPress ? (
|
||||||
<View style={styles.importPillRow}>
|
<View style={styles.importPillRow}>
|
||||||
<View style={styles.importPillContent}>
|
<View style={styles.importPillContent}>
|
||||||
<ComposerImportPill onPress={onOpenImportSheet} disabled={isSubmitting} />
|
<ComposerImportPill onPress={importPillPress} />
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
Reference in New Issue
Block a user