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

session alert

parent c9173bc4
import { Alert } from 'react-native';
export default function session(response,error_status, navigation) {
import { Alert,ToastAndroid } from 'react-native';
export default function session(response, error_status, navigation) {
if (response.code === "WRONG_SESSION_ID") {
Alert.alert(
'Session',
'Session Anda Sudah Habis Silahkan Logout Terlebih Dahulu ! ',
[
{ text: 'OK', onPress: () => navigation.replace('Login') }
]
)
} else if (error_status == 500) {
if (error_status != 500) {
if (response.code == "WRONG_SESSION_ID") {
Alert.alert('',response_data.msg);
} else {
Alert.alert('',response_data.msg);
}
} else {
Alert.alert(
'Server',
'Server Error ',
......@@ -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