Commit c466856b authored by Trisno's avatar Trisno

loading bar muncul, setiap bolak balik dari halaman lain

parent 16805722
......@@ -38,6 +38,10 @@ class Outlets extends React.Component {
componentDidMount() {
this._getOutletClosest()
this.OrderedList()
this._getPermissions()
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true,
......@@ -49,6 +53,10 @@ class Outlets extends React.Component {
}
componentWillUnmount() {
this._unsubscribe()
}
_getPermissions = async () => {
let { status } = await Permissions.askAsync(Permissions.LOCATION);
if (status !== 'granted') {
......@@ -176,7 +184,7 @@ class Outlets extends React.Component {
let outletName = res.data.data.outlet_name
this.setState({
indicator: false,
// indicator: false,
data_name: outletName
})
......
......@@ -17,6 +17,9 @@ class RewardsList extends React.Component {
componentDidMount() {
this.getRewardsList()
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true
})
this.getRewardsList()
});
......
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