Skip to content

Commit 658d928

Browse files
committed
chore: code improvements
1 parent 5912f95 commit 658d928

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

app/containers/Toast.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,12 @@ const Toast = (): React.ReactElement => {
4242
};
4343

4444
const showToast = ({ message }: { message: string }) => {
45+
if (alertDisplayType === 'DIALOG') {
46+
Alert.alert(message);
47+
return;
48+
}
4549
if (toast && toast.show) {
46-
switch (alertDisplayType) {
47-
case 'DIALOG':
48-
Alert.alert(message);
49-
break;
50-
case 'TOAST':
51-
toast.show(message, 1000);
52-
break;
53-
}
50+
toast.show(message, 1000);
5451
}
5552
};
5653

app/views/AccessibilityAndAppearanceView/components/ListPicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const OPTIONS: TOPTIONS = [
5151
];
5252

5353
interface IBaseParams {
54-
value: string;
54+
value: TAlertDisplayType;
5555
onChangeValue: (value: TAlertDisplayType) => void;
5656
}
5757

@@ -64,7 +64,7 @@ const ListPicker = ({
6464
} & IBaseParams) => {
6565
const { showActionSheet, hideActionSheet } = useActionSheet();
6666
const { colors } = useTheme();
67-
const option = OPTIONS.find(option => option.value === value) || OPTIONS[2];
67+
const option = OPTIONS.find(option => option.value === value) || OPTIONS[0];
6868

6969
const getOptions = (): TActionSheetOptionsItem[] =>
7070
OPTIONS.map(i => ({

0 commit comments

Comments
 (0)