Created
June 14, 2021 12:14
-
-
Save u1735067/01611e017d874af51cb52ceefecc2d5d to your computer and use it in GitHub Desktop.
Old patch for https://github.com/watsonbox/exportify/commit/7db76bff1a6247fbf84f60083d139b4a4e1bc292
This file contains hidden or 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
From 34db8a351b8fc43362bcbf0cba9e186b2c3a1b80 Mon Sep 17 00:00:00 2001 | |
From: "Alexandre L." | |
Date: Tue, 7 Jul 2015 19:25:22 +0200 | |
Subject: [PATCH] Dirty workaround | |
--- | |
exportify.js | 14 ++++++++++++-- | |
1 file changed, 12 insertions(+), 2 deletions(-) | |
diff --git a/exportify.js b/exportify.js | |
index fd54596..b8404f5 100644 | |
--- a/exportify.js | |
+++ b/exportify.js | |
@@ -1,3 +1,11 @@ | |
+function sleep(milliseconds) { | |
+ var start = new Date().getTime(); | |
+ for (var i = 0; i < 1e7; i++) { | |
+ if ((new Date().getTime() - start) > milliseconds){ | |
+ break; | |
+ } | |
+ } | |
+} | |
window.Helpers = { | |
authorize: function() { | |
var client_id = this.getQueryParam('app_client_id'); | |
@@ -23,7 +31,7 @@ window.Helpers = { | |
}, | |
apiCall: function(url, access_token) { | |
- return $.ajax({ | |
+ result = $.ajax({ | |
url: url, | |
headers: { | |
'Authorization': 'Bearer ' + access_token | |
@@ -39,7 +47,9 @@ window.Helpers = { | |
// Otherwise report the error so user can raise an issue | |
alert(jqXHR.responseText); | |
} | |
- }) | |
+ }); | |
+ sleep(500); | |
+ return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment