From dab29b8a1549463177cb0353518d9cec15697f1c Mon Sep 17 00:00:00 2001 From: Rodrigo Pombo Date: Sun, 24 Feb 2019 02:03:31 -0300 Subject: [PATCH] Fix bitbucket landing --- src/git-providers/bitbucket-provider.js | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/git-providers/bitbucket-provider.js b/src/git-providers/bitbucket-provider.js index b7f253c..e561938 100644 --- a/src/git-providers/bitbucket-provider.js +++ b/src/git-providers/bitbucket-provider.js @@ -1,5 +1,4 @@ import netlify from "netlify-auth-providers"; -import { Base64 } from "js-base64"; import React from "react"; const TOKEN_KEY = "bitbucket-token"; @@ -27,23 +26,18 @@ async function getContent(repo, sha, path) { } const content = await contentResponse.text(); - // const content = Base64.decode(contentJson.content); + return { content }; } function getUrlParams() { - const [ - , - owner, - reponame, - action, - sha, - ...paths - ] = window.location.pathname.split("/"); + const [, owner, reponame, , sha, ...paths] = window.location.pathname.split( + "/" + ); - // if (action !== "commits" && action !== "blob") { - // return []; - // } + if (!sha) { + return []; + } return [owner + "/" + reponame, sha, paths.join("/")]; }