diff options
| -rw-r--r-- | packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx b/packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx index f9341bf9..25e14281 100644 --- a/packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx +++ b/packages/cli/src/ui/privacy/CloudFreePrivacyNotice.tsx @@ -4,7 +4,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { Box, Newline, Text } from 'ink'; +import { Box, Newline, Text, useInput } from 'ink'; import { RadioButtonSelect } from '../components/shared/RadioButtonSelect.js'; import { usePrivacySettings } from '../hooks/usePrivacySettings.js'; import { CloudPaidPrivacyNotice } from './CloudPaidPrivacyNotice.js'; @@ -23,15 +23,24 @@ export const CloudFreePrivacyNotice = ({ const { privacyState, updateDataCollectionOptIn } = usePrivacySettings(config); + useInput((input, key) => { + if (privacyState.error && key.escape) { + onExit(); + } + }); + if (privacyState.isLoading) { return <Text color={Colors.Gray}>Loading...</Text>; } if (privacyState.error) { return ( - <Text color={Colors.AccentRed}> - Error loading Opt-in settings: {privacyState.error} - </Text> + <Box flexDirection="column" marginY={1}> + <Text color={Colors.AccentRed}> + Error loading Opt-in settings: {privacyState.error} + </Text> + <Text color={Colors.Gray}>Press Esc to exit.</Text> + </Box> ); } |
