From 7c5fac67edf4e265176d57b714bd21cdc8c8aa7d Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Fri, 11 Mar 2022 12:58:22 +0100 Subject: move requestbuffer into request and fix preanims --- webAO/client.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index a0dd895..835d8d2 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -2649,40 +2649,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. */ -- cgit