Skip to content

Instantly share code, notes, and snippets.

@wbobeirne
Created May 7, 2019 22:50
Show Gist options
  • Save wbobeirne/3b05d0dc4910df6c9ac9fdb7e26635a2 to your computer and use it in GitHub Desktop.
Save wbobeirne/3b05d0dc4910df6c9ac9fdb7e26635a2 to your computer and use it in GitHub Desktop.
private checkIfPaid = () => {
setTimeout(() => {
const { pendingPost } = this.state;
if (!pendingPost) return;
api.getPost(pendingPost.id).then(p => {
if (p.hasPaid) {
window.location.reload();
} else {
this.checkIfPaid();
}
});
}, 1000);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment