Skip to content

Commit 8b8faf0

Browse files
committed
fix issue #11
1 parent 79cfca1 commit 8b8faf0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

js/main.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,15 @@ function updateHistory(path) {
133133
window.resopnse2imgSrc = (response) => {
134134
// extracts img-src from GitHub API octokit response
135135
// console.log(response);
136-
var b64content = response.data.content;
137-
if (b64content) {
136+
var download_url = response.data.download_url;
137+
if (download_url) {
138+
return download_url;
139+
} else if (response.data.content) {
138140
return `data:${mime.getType(
139141
response.data.name
140142
)};base64,${response.data.content.replaceAll("\n", "")}`;
141143
} else {
142-
return response.data.download_url;
144+
return null;
143145
}
144146
};
145147

0 commit comments

Comments
 (0)