Commit 0cdf9700 authored by Jacob Schatz's avatar Jacob Schatz

Initially load PNG.

parent f658d26c
......@@ -117,6 +117,7 @@ const RepoHelper = {
getContent(treeOrFile, cb) {
let file = treeOrFile;
console.log('file',file)
// const loadingData = RepoHelper.setLoading(true);
return Service.getContent()
.then((response) => {
......@@ -130,7 +131,8 @@ const RepoHelper = {
if (data.binary) {
Store.binaryMimeType = data.mime_type;
const rawUrl = RepoHelper.getRawURLFromBlobURL(file.url);
// file might be undefined
const rawUrl = RepoHelper.getRawURLFromBlobURL(file.url || Service.url);
RepoHelper.setBinaryDataAsBase64(rawUrl, data);
data.binary = true;
} else {
......@@ -161,8 +163,9 @@ const RepoHelper = {
Store.prevURL = Service.blobURLtoParentTree(Service.url);
}
})
.catch(() => {
.catch((e) => {
// RepoHelper.setLoading(false, loadingData);
console.log('catch', e)
RepoHelper.loadingError();
});
},
......
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