Injector v4.2.1: Local module fix, large modules fix

pull/8/head
Oj18 4 years ago
parent ae2ab98a2b
commit e9eb8135b6

@ -1,5 +1,12 @@
# GooseMod Changelog
## v4.2.1
- ### Fixes
- Fixed local module importing and only ask for one file
- Fix large (>~1MB) modules failing to load
## v4.2.0
- ### Features

6
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

@ -101,7 +101,7 @@ const init = async function () {
this.modules = {};
this.disabledModules = {};
this.version = '4.2.0';
this.version = '4.2.1';
this.versionHash = '<hash>'; // hash of built final js file is inserted here via build script
this.logger.debug('import.version.goosemod', `${this.version} (${this.versionHash})`);

@ -79,15 +79,21 @@ export const getModuleFiles = async () => { // Ask for module files (one by one
let allFiles = [];
while (true) {
let files = await DiscordNative.fileManager.openFiles(); // Ask for file (singular)
//while (true) {
let files = await DiscordNative.fileManager.openFiles({
filters: [
{name: 'JS Files', extensions: ['js']},
{name: 'All Files', extensions: ['*']}
],
properties: ['openFile']
}); // Ask for file (singular)
if (files.length === 0) { // If no file, stop asking for files
break;
//break;
}
allFiles.push(files[0]); // Add file to files array
}
//}
goosemodScope.logger.debug('import.fileask', 'Finished asking for files');

@ -1,3 +1,4 @@
export default (buf) => { // ArrayBuffer (UTF-8) -> String
return String.fromCharCode.apply(null, new Uint8Array(buf));
return new TextDecoder().decode(buf);
//return String.fromCharCode.apply(null, new Uint8Array(buf));
};
Loading…
Cancel
Save