Skip to content

Commit

Permalink
fix: remove unwanted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eudiwtech committed Jan 13, 2025
1 parent da28c22 commit 9805f14
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
14 changes: 1 addition & 13 deletions ts/components/LoadingScreenContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
WithTestID
} from '@pagopa/io-app-design-system';
import * as React from 'react';
import {AccessibilityInfo, Platform, StyleSheet, View} from 'react-native';
import {StyleSheet, View} from 'react-native';
import {SafeAreaView} from 'react-native-safe-area-context';
import {LoadingIndicator} from './LoadingIndicator';

Expand Down Expand Up @@ -39,18 +39,6 @@ export const LoadingScreenContent = (props: LoadingScreenContentProps) => {
const theme = useIOTheme();
const {contentTitle, children, headerVisible, testID} = props;

React.useEffect(() => {
// Since the screen is shown for a very short time,
// we prefer to announce the content to the screen reader,
// instead of focusing the first element.
if (Platform.OS === 'android') {
// We use it only on Android, because on iOS the screen reader
// stops reading the content when the ingress screen is unmounted
// and the focus is moved to another element.
AccessibilityInfo.announceForAccessibility(contentTitle);
}
}, [contentTitle]);

return (
<SafeAreaView
style={[
Expand Down
12 changes: 3 additions & 9 deletions ts/features/wallet/screens/pidIssuance/Issuance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import {
import LoadingScreenContent from '../../../../components/LoadingScreenContent';
import CredentialPreviewClaimsList from '../../components/CredentialPreviewClaimsList';
import {StoredCredential} from '../../utils/types';
import {Lifecycle, setLifecycle} from '../../store/lifecycle';
import {addCredential} from '../../store/credentials';
import {addCredentialWithIdentification} from '../../store/credentials';

/**
* Screen which starts and handles the PID issuance flow.
Expand Down Expand Up @@ -57,12 +56,6 @@ const Issuance = () => {
navigation.navigate('MAIN_TAB_NAV');
};

const onAdd = (pidToAdd: StoredCredential) => {
dispatch(addCredential({credential: pidToAdd}));
dispatch(setLifecycle({lifecycle: Lifecycle.LIFECYCLE_VALID}));
navigation.navigate('MAIN_WALLET', {screen: 'SUCCESS'});
};

const PidPreview = ({credential}: {credential: StoredCredential}) => (
<>
<ForceScrollDownView contentContainerStyle={styles.scroll}>
Expand All @@ -79,7 +72,8 @@ const Issuance = () => {
actions={{
primary: {
label: t('wallet:pidIssuance.preview.button'),
onPress: () => onAdd(credential),
onPress: () =>
dispatch(addCredentialWithIdentification({credential})),
icon: 'add',
iconPosition: 'end'
},
Expand Down
2 changes: 0 additions & 2 deletions ts/screens/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ const Settings = () => {
{
label: t('settings.listHeaders.test.onboardingReset'),
onPress: () => {
dispatch(setLifecycle({lifecycle: Lifecycle.LIFECYCLE_OPERATIONAL}));
dispatch(preferencesReset());
toast.success(t('generics.success'));
}
}
];
Expand Down

0 comments on commit 9805f14

Please sign in to comment.