Commit 96eb77fc authored by Trisno's avatar Trisno

outlet_id di set hanya ketika kosong

parent 18dd3607
...@@ -36,12 +36,24 @@ class Home extends React.Component { ...@@ -36,12 +36,24 @@ class Home extends React.Component {
componentDidMount() { componentDidMount() {
console.log('ini outlet id' + this.props.outlet_id)
console.log('ini nama outlet ' + this.props.name_outlet)
console.log('ini alamat outlet ' + this.props.outlet_detailadress)
const screenWidth = Math.round(Dimensions.get('window').width); const screenWidth = Math.round(Dimensions.get('window').width);
this.setState({ this.setState({
slider_height: screenWidth slider_height: screenWidth
}) })
this._account(); this._account();
this._getPermissions()
if (this.props.outlet_id == '' && this.props.name_outlet == '' && this.props.outlet_detailadress == '') {
this._getPermissions()
} else {
this.setState({
indicator: false
})
}
this._renderCarousell() this._renderCarousell()
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
...@@ -49,7 +61,13 @@ class Home extends React.Component { ...@@ -49,7 +61,13 @@ class Home extends React.Component {
indicator: true, indicator: true,
}) })
this._account(); this._account();
this._getPermissions() if (this.props.outlet_id == '' && this.props.name_outlet == '' && this.props.outlet_detailadress == '') {
this._getPermissions()
} else {
this.setState({
indicator: false
})
}
this._renderCarousell() this._renderCarousell()
}); });
...@@ -195,7 +213,7 @@ class Home extends React.Component { ...@@ -195,7 +213,7 @@ class Home extends React.Component {
_orderNow = () => { _orderNow = () => {
if (this.props.outlet_id != '' && this.props.name_outlet != '') { if (this.props.outlet_id != '' && this.props.name_outlet != '') {
this.props.setTypePickup(true) // this.props.setTypePickup(true)
this.props.navigation.navigate('Home', { this.props.navigation.navigate('Home', {
screen: 'MENU', screen: 'MENU',
params: { user: 'jaxi' }, params: { user: 'jaxi' },
...@@ -330,7 +348,7 @@ class Home extends React.Component { ...@@ -330,7 +348,7 @@ class Home extends React.Component {
{i18n.t('orderInfo')} {i18n.t('orderInfo')}
</Text> */} </Text> */}
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#838383' }}> <Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#838383' }}>
OUR DRIVER WILL DELIVER YOUR ORDER TO OUR DRIVER WILL DELIVER YOUR ORDER TO
</Text> </Text>
{this.state.indicator == true ? ( {this.state.indicator == true ? (
<ActivityIndicator size="small" color="#c9af6d" /> <ActivityIndicator size="small" color="#c9af6d" />
...@@ -645,6 +663,7 @@ const mapStateToProps = (state) => { ...@@ -645,6 +663,7 @@ const mapStateToProps = (state) => {
email: state.email, email: state.email,
outlet_id: state.outlet_id, outlet_id: state.outlet_id,
name_outlet: state.name_outlet, name_outlet: state.name_outlet,
outlet_detailadress: state.name_outlet,
session_id: state.session_id, session_id: state.session_id,
password: state.password, password: state.password,
fb_token: state.fb_token, fb_token: state.fb_token,
......
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