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

Initially load PNG.

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