fix(bitbucket): fix rebasing mistakes in bitbucket backend and deps (#1522)

This commit is contained in:
Shawn Erquhart
2018-07-26 13:42:19 -04:00
committed by GitHub
parent 6eb86957d0
commit bdfd9443db
8 changed files with 9 additions and 11 deletions

View File

@ -1,6 +1,6 @@
import { flow } from "lodash";
import { flow, has } from "lodash";
import {
LocalForage,
localForage,
unsentRequest,
responseParser,
then,
@ -67,13 +67,13 @@ export default class API {
readFile = async (path, sha, { ref = this.branch, parseText = true } = {}) => {
const cacheKey = parseText ? `bb.${ sha }` : `bb.${ sha }.blob`;
const cachedFile = sha ? await LocalForage.getItem(cacheKey) : null;
const cachedFile = sha ? await localForage.getItem(cacheKey) : null;
if (cachedFile) { return cachedFile; }
const result = await this.request({
url: `${ this.repoURL }/src/${ ref }/${ path }`,
cache: "no-store",
}).then(parseText ? responseParser({ format: "text" }) : responseParser({ format: "blob" }));
if (sha) { LocalForage.setItem(cacheKey, result); }
if (sha) { localForage.setItem(cacheKey, result); }
return result;
}

View File

@ -35,10 +35,12 @@ export default class BitbucketAuthenticationPage extends React.Component {
};
render() {
const { inProgress } = this.props;
return (
<AuthenticationPage
onLogin={this.handleLogin}
loginDisabled={this.props.inProgress}
loginDisabled={inProgress}
loginErrorMessage={this.state.loginError}
renderButtonContent={() => (
<React.Fragment>

View File

@ -81,7 +81,7 @@ export default class Bitbucket {
base_url: this.base_url,
site_id: this.site_id,
};
this.authenticator = new Authenticator(cfg);
this.authenticator = new NetlifyAuthenticator(cfg);
}
this.refreshedTokenPromise = this.authenticator.refresh({ provider: "bitbucket", refresh_token: this.refreshToken })