Commit 45bfbfc6 authored by Ivanq's avatar Ivanq

ZeroFS: Pass additional 'bytes' parameter to readFile()

parent 85706b32
......@@ -19,7 +19,7 @@ class ZeroFS {
return Promise.resolve(children.indexOf(basePath) > -1);
});
}
readFile(file) {
readFile(file, bytes) {
return this.page.cmd("fileGet", [
file, // file
false, // required (wait until file exists)
......@@ -29,7 +29,7 @@ class ZeroFS {
if(res === null || res === false) {
return Promise.reject("File doesn't exist: " + file);
} else {
return Promise.resolve(this.fromBase64(res, true));
return Promise.resolve(this.fromBase64(res, bytes));
}
});
}
......
......@@ -70,7 +70,7 @@ class Git {
// FileSystem commands
readFile(path) {
return this.zeroFS.readFile(this.root + "/" + path)
return this.zeroFS.readFile(this.root + "/" + path, true)
.then(file => {
return new Uint8Array(file.split("").map(char => char.charCodeAt(0)));
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment