Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. locationPing() {
  2. if (this.props.accountData.check_type === "PROPERTY" || this.props.accountData.check_type === "PROJECT") {
  3.  
  4. if(this.lastRound === 0 || (this.intervalRound * 5000) - (this.lastRound * 5000) >= this.props.accountData.ping * 1000) {
  5. this.lastRound = this.intervalRound;
  6. locationChangeHandler(this.props.accessToken, this.props.longitude, this.props.latitude)
  7. .then((data) => {
  8.  
  9. switch (data.code) {
  10. case 'error':
  11. Alert.alert(
  12. 'Error',
  13. data.message
  14. );
  15. break;
  16. case 'success':
  17. this.props.onAccountData(JSON.parse(data.data));
  18. break;
  19. }
  20.  
  21. })
  22. .catch((data) => {});
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement