Created
June 27, 2017 12:46
-
-
Save 8lane/4f3ff9fada784d66f447c8ff13028628 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
data = JSON.parse(data); | |
if (data.length > 0) { | |
if (data[0].timestamp === _this.lastTimestamp) { | |
_this.itemIndex = 0; | |
_this.lastTimestamp = null; | |
_this.isPolling = false; | |
_this.startPoll(); | |
} else { | |
_this.addItem(data[0], temp).then(function() { | |
_this.itemIndex = _this.itemIndex + 1; | |
_this.lastTimestamp = data[0].timestamp; | |
_this.isPolling = false; | |
_this.startPoll(); | |
}); | |
} | |
} else { | |
_this.isPolling = false; | |
_this.poll(true); | |
} | |
} catch (e) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment