diff --git a/package.json b/package.json index 232171e..d0c4758 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "dependencies": { "diff": "^4.0.1", + "js-base64": "^2.5.1", "netlify-auth-providers": "^1.0.0-alpha5", "prismjs": "^1.15.0", "react": "^16.8.1", diff --git a/src/github.js b/src/github.js index 2b06b23..cefee36 100644 --- a/src/github.js +++ b/src/github.js @@ -1,5 +1,6 @@ -import { getLanguageDependencies } from "./language-detector"; import netlify from "netlify-auth-providers"; +import { Base64 } from "js-base64"; +import { getLanguageDependencies } from "./language-detector"; const TOKEN_KEY = "github-token"; function getHeaders() { @@ -21,7 +22,7 @@ async function getContent(repo, sha, path) { throw contentResponse; } const contentJson = await contentResponse.json(); - const content = window.atob(contentJson.content); + const content = Base64.decode(contentJson.content); return { content, url: contentJson.html_url }; } diff --git a/yarn.lock b/yarn.lock index 21a43a1..67fc8bd 100755 --- a/yarn.lock +++ b/yarn.lock @@ -5595,6 +5595,11 @@ joi@^11.1.1: isemail "3.x.x" topo "2.x.x" +js-base64@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.1.tgz#1efa39ef2c5f7980bb1784ade4a8af2de3291121" + integrity sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw== + js-levenshtein@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.4.tgz#3a56e3cbf589ca0081eb22cd9ba0b1290a16d26e"