mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-20 02:46:23 +00:00
Remove compression cache feature
Some checks failed
Make Latest Folder On EmulatorJS CDN / run (push) Has been cancelled
Some checks failed
Make Latest Folder On EmulatorJS CDN / run (push) Has been cancelled
This commit is contained in:
parent
588a5e2beb
commit
685f3ebfef
1 changed files with 0 additions and 6 deletions
|
@ -1,5 +1,4 @@
|
||||||
class EJS_COMPRESSION {
|
class EJS_COMPRESSION {
|
||||||
cache = {};
|
|
||||||
constructor(EJS) {
|
constructor(EJS) {
|
||||||
this.EJS = EJS;
|
this.EJS = EJS;
|
||||||
}
|
}
|
||||||
|
@ -37,16 +36,12 @@ class EJS_COMPRESSION {
|
||||||
path = "compression/libunrar.js";
|
path = "compression/libunrar.js";
|
||||||
obj = "rar";
|
obj = "rar";
|
||||||
}
|
}
|
||||||
if (this.cache[obj]) {
|
|
||||||
return this.cache[obj];
|
|
||||||
}
|
|
||||||
this.EJS.downloadFile(path, (res) => {
|
this.EJS.downloadFile(path, (res) => {
|
||||||
if (res === -1) {
|
if (res === -1) {
|
||||||
this.EJS.startGameError(this.EJS.localization('Network Error'));
|
this.EJS.startGameError(this.EJS.localization('Network Error'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (method === "rar") {
|
if (method === "rar") {
|
||||||
// Do not cache rar. This shouldnt normally be used more than once anyways.
|
|
||||||
this.EJS.downloadFile("compression/libunrar.wasm", (res2) => {
|
this.EJS.downloadFile("compression/libunrar.wasm", (res2) => {
|
||||||
if (res2 === -1) {
|
if (res2 === -1) {
|
||||||
this.EJS.startGameError(this.EJS.localization('Network Error'));
|
this.EJS.startGameError(this.EJS.localization('Network Error'));
|
||||||
|
@ -63,7 +58,6 @@ class EJS_COMPRESSION {
|
||||||
const blob = new Blob([res.data], {
|
const blob = new Blob([res.data], {
|
||||||
type: 'application/javascript'
|
type: 'application/javascript'
|
||||||
})
|
})
|
||||||
this.cache[obj] = blob;
|
|
||||||
resolve(blob);
|
resolve(blob);
|
||||||
}
|
}
|
||||||
}, null, false, {responseType: "arraybuffer", method: "GET"});
|
}, null, false, {responseType: "arraybuffer", method: "GET"});
|
||||||
|
|
Loading…
Reference in a new issue