Commit 06b84cb9 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

session alert

parent c9173bc4
import { Alert } from 'react-native'; import { Alert,ToastAndroid } from 'react-native';
export default function session(response,error_status, navigation) { export default function session(response, error_status, navigation) {
if (response.code === "WRONG_SESSION_ID") { if (error_status != 500) {
if (response.code == "WRONG_SESSION_ID") {
Alert.alert( Alert.alert('',response_data.msg);
'Session', } else {
'Session Anda Sudah Habis Silahkan Logout Terlebih Dahulu ! ', Alert.alert('',response_data.msg);
[ }
} else {
{ text: 'OK', onPress: () => navigation.replace('Login') }
]
)
} else if (error_status == 500) {
Alert.alert( Alert.alert(
'Server', 'Server',
'Server Error ', 'Server Error ',
...@@ -23,7 +18,5 @@ export default function session(response,error_status, navigation) { ...@@ -23,7 +18,5 @@ export default function session(response,error_status, navigation) {
] ]
) )
}else{
Alert.alert(response_data.msg);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment