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