87 lines
2.9 KiB
TypeScript
87 lines
2.9 KiB
TypeScript
// Metro module 16723 (f16724).
|
|
import { useState } from "react";
|
|
import { View } from "react-native";
|
|
import { createStyles } from "../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../_bundle/Module712";
|
|
import { useNavigation } from "../../../design/components/Navigator/native/useNavigation.native";
|
|
import { getCurrentTask } from "../SafetyFlowsActionCreators";
|
|
import { navigateToScreenForTask } from "./SafetyFlowsUtils";
|
|
import { Text } from "../../../design/components/Text/native/Text";
|
|
import { intl, t } from "../../../intl/index.native";
|
|
import { Stack } from "../../../design/components/Stack/native/Stack.native";
|
|
import { Button } from "../../../design/components/Button/native/Button.native";
|
|
import AuthenticationActionCreators from "../../../actions/AuthenticationActionCreators";
|
|
const useStyles = createStyles({
|
|
container: {
|
|
flexDirection: "column",
|
|
justifyContent: "center",
|
|
gap: Module712.space.PX_8,
|
|
padding: Module712.space.PX_16,
|
|
alignItems: "center"
|
|
},
|
|
buttonContainer: {
|
|
marginTop: Module712.space.PX_8
|
|
}
|
|
});
|
|
export default function ErrorScreen() {
|
|
let navigation;
|
|
let _handleRetry2 = function _handleRetry() {
|
|
const r9 = async () => {
|
|
let c31106_2;
|
|
let c31106_3 = 0;
|
|
let c31839_0;
|
|
try {
|
|
c31839_0 = void 0;
|
|
c31106_3 = 1;
|
|
setState(true);
|
|
c31839_0 = await getCurrentTask();
|
|
if (c31839_0 != null) {
|
|
navigateToScreenForTask(navigation, c31839_0);
|
|
}
|
|
c31106_3 = 0;
|
|
(0, setState)(false);
|
|
} catch ($e) {
|
|
const r27 = $e;
|
|
let r7 = r27;
|
|
c31106_2 = r27;
|
|
if (c31106_3 !== 0) {
|
|
while (true) {
|
|
try {
|
|
const r77 = c31106_2;
|
|
c31106_3 = 0;
|
|
(0, setState)(false);
|
|
throw r77;
|
|
} catch (r74) {
|
|
r7 = r74;
|
|
c31106_2 = r74;
|
|
if (c31106_3 === 0) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw r7;
|
|
}
|
|
};
|
|
_handleRetry2 = r9;
|
|
return r9.apply(this, arguments);
|
|
};
|
|
const [loading, setState] = useState(false);
|
|
navigation = useNavigation();
|
|
const styles = useStyles();
|
|
return <View style={styles.container}>
|
|
<Text variant="heading-lg/semibold">
|
|
{intl.string(t.c6kn6F)}
|
|
</Text>
|
|
<Text variant="text-md/normal" color="text-muted">
|
|
{intl.string(t.ZUEGFn)}
|
|
</Text>
|
|
<Stack style={styles.buttonContainer} spacing={8}>
|
|
<Button onPress={() => AuthenticationActionCreators.logout("safety_flows_error_screen")} text={intl.string(t["2jxGer"])} variant="secondary" size="md" />
|
|
<Button onPress={function handleRetry() {
|
|
return _handleRetry2.apply(this, arguments);
|
|
}} text={intl.string(t["7NqTJn"])} variant="primary" size="md" loading={loading} />
|
|
</Stack>
|
|
</View>;
|
|
};
|