Commit f72d6870 authored by Afid's avatar Afid

klo belum dapat location jgn load menu

parent dcb8f60a
import React from 'react'; import React from 'react';
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, FlatList, Button, StatusBar, ActivityIndicator } from 'react-native'; import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, FlatList, Button, StatusBar, ActivityIndicator, Alert } from 'react-native';
import Axios from 'axios'; import Axios from 'axios';
import Item from './Item'; import Item from './Item';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
...@@ -24,8 +24,23 @@ class MenuSelection extends React.Component { ...@@ -24,8 +24,23 @@ class MenuSelection extends React.Component {
} }
} }
componentDidMount() { componentDidMount() {
this.getMenuList() if (this.props.outlet_id != '') {
this.getMenuList()
} else {
Alert.alert('Device belum mendapatkan lokasi anda')
}
console.log("INI OUTLET : "+ this.props.outlet_id) console.log("INI OUTLET : "+ this.props.outlet_id)
this._unsubscribe = this.props.navigation.addListener('focus', () => {
if (this.props.outlet_id != '') {
this.getMenuList()
} else {
Alert.alert('Device belum mendapatkan lokasi anda')
}
});
}
componentWillUnmount() {
this._unsubscribe();
} }
getMenuList() { getMenuList() {
......
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