diff options
| author | stonedDiscord <Tukz@gmx.de> | 2022-03-11 12:58:22 +0100 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2022-03-11 12:58:22 +0100 |
| commit | 7c5fac67edf4e265176d57b714bd21cdc8c8aa7d (patch) | |
| tree | 3c16a41c3a7abc5c2e31f69388afa9f931428764 /webAO/client.js | |
| parent | a8e26dce73b694aeeefc0be52147a36ced5975c9 (diff) | |
move requestbuffer into request and fix preanims
Diffstat (limited to 'webAO/client.js')
| -rw-r--r-- | webAO/client.js | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/webAO/client.js b/webAO/client.js index a0dd895..835d8d2 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -2650,40 +2650,6 @@ export function opusCheck(channel) { window.opusCheck = opusCheck; /** - * Make a GET request for a specific URI. - * @param {string} url the URI to be requested - * @returns response data - * @throws {Error} if status code is not 2xx, or a network error occurs - */ -async function requestBuffer(url) { - return new Promise((resolve, reject) => { - const xhr = new XMLHttpRequest(); - xhr.responseType = 'arraybuffer'; - xhr.addEventListener('error', () => { - const err = new Error(`Request for ${url} failed: ${xhr.statusText}`); - err.code = xhr.status; - reject(err); - }); - xhr.addEventListener('abort', () => { - const err = new Error(`Request for ${url} was aborted!`); - err.code = xhr.status; - reject(err); - }); - xhr.addEventListener('load', () => { - if (xhr.status < 200 || xhr.status >= 300) { - const err = new Error(`Request for ${url} failed with status code ${xhr.status}`); - err.code = xhr.status; - reject(err); - } else { - resolve(xhr.response); - } - }); - xhr.open('GET', url, true); - xhr.send(); - }); -} - -/** * Triggered when the reconnect button is pushed. */ export function ReconnectButton() { |
