Skip to content

Commit

Permalink
fix: send to sign in when using showBlockstackConnect, fixes leather-…
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Jul 24, 2020
1 parent 1b44248 commit d7698e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/connect/src/ui.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react';
import ReactDOM from 'react-dom';
import { useConnect, Connect } from './react';
import { AuthOptions } from './auth';
import { AuthOptions, authenticate } from './auth';

const Base: React.FC = () => {
const { doOpenAuth } = useConnect();
Expand All @@ -19,6 +19,9 @@ const Base: React.FC = () => {
};

export const showBlockstackConnect = (authOptions: AuthOptions) => {
if (authOptions.sendToSignIn) {
return authenticate(authOptions);
}
const baseDiv = document.createElement('div');
document.body.appendChild(baseDiv);
ReactDOM.render(
Expand All @@ -27,4 +30,5 @@ export const showBlockstackConnect = (authOptions: AuthOptions) => {
</Connect>,
baseDiv
);
return;
};

0 comments on commit d7698e8

Please sign in to comment.