Skip to content

Commit c03e18c

Browse files
committed
fix: logs
1 parent 4fa29b9 commit c03e18c

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

ts/features/settings/devMode/playgrounds/Cie/navigation/CiePlaygroundsNavigator.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export const CiePlaygroundsNavigator = () => {
2424
* Set CIE logger to local file mode when the playground is mounted, and disable it when unmounted.
2525
*/
2626
useEffect(() => {
27-
CieLogger.setLogMode("localFile");
27+
CieLogger.setLogMode("FILE");
2828
return () => {
29-
CieLogger.setLogMode("disabled");
29+
CieLogger.setLogMode("DISABLED");
3030
};
3131
}, []);
3232

ts/features/settings/devMode/playgrounds/Cie/screens/CiePlaygrounds.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
ListItemHeader,
44
ListItemInfo,
55
ListItemNav,
6+
useIOToast,
67
VStack
78
} from "@pagopa/io-app-design-system";
89
import { CieLogger, CieUtils } from "@pagopa/io-react-native-cie";
@@ -16,6 +17,7 @@ import { CIE_PLAYGROUNDS_ROUTES } from "../navigation/routes";
1617

1718
export const CiePlaygrounds = () => {
1819
const navigation = useCieNavigation();
20+
const toast = useIOToast();
1921
const [hasNFC, setHasNFC] = useState<boolean | undefined>();
2022
const [isNFCEnabled, setIsNFCEnabled] = useState<boolean | undefined>();
2123
const [isCieAuthenticationSupported, setIsCieAuthenticationSupported] =
@@ -44,11 +46,7 @@ export const CiePlaygrounds = () => {
4446
data: logs
4547
});
4648
} catch (e) {
47-
navigation.navigate(CIE_PLAYGROUNDS_ROUTES.RESULT, {
48-
title: "Logs",
49-
data: e,
50-
isError: true
51-
});
49+
toast.error("Perform a test first to generate some logs");
5250
}
5351
}
5452
};

ts/features/settings/devMode/playgrounds/Cie/screens/CieResultScreen.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export type Props = IOStackNavigationRouteProps<
1313
>;
1414

1515
export function CieResultScreen({ route }: Props) {
16-
const { title, data, isError = false } = route.params;
16+
const { title, data } = route.params;
1717

1818
useHeaderSecondLevel({
19-
title: `${isError ? "Error" : "Result"}: ${title}`
19+
title
2020
});
2121

2222
const handleCopy = async () => {
@@ -34,8 +34,8 @@ export function CieResultScreen({ route }: Props) {
3434
...(Platform.OS === "ios" ? { url: title } : {})
3535
},
3636
{
37-
subject: `${title} ${isError ? "Error" : "Result"}`,
38-
dialogTitle: `Share ${title} ${isError ? "Error" : "Result"}`
37+
subject: `${title} "Result"`,
38+
dialogTitle: `Share ${title} "Result"`
3939
}
4040
);
4141
} catch (error) {
@@ -59,10 +59,7 @@ export function CieResultScreen({ route }: Props) {
5959
}
6060
}}
6161
>
62-
<View
63-
style={[styles.content, isError && styles.contentError]}
64-
pointerEvents="box-only"
65-
>
62+
<View style={styles.content} pointerEvents="box-only">
6663
<IOText
6764
font="FiraCode"
6865
size={12}
@@ -91,8 +88,5 @@ const styles = StyleSheet.create({
9188
content: {
9289
backgroundColor: IOColors["grey-50"],
9390
padding: 8
94-
},
95-
contentError: {
96-
backgroundColor: IOColors["error-100"]
9791
}
9892
});

0 commit comments

Comments
 (0)