mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Moved AuthFrame back to use useEffect
This commit is contained in:
parent
08cc74c894
commit
eea1bf19a1
1 changed files with 6 additions and 4 deletions
|
@ -9,10 +9,12 @@ import setupGhostApi from './utils/api';
|
|||
import CommentsBox from './components/CommentsBox';
|
||||
import {useEffect} from 'react';
|
||||
|
||||
function AuthFrame({adminUrl, onLoad}) {
|
||||
function AuthFrame({adminUrl, onLoad, initStatus}) {
|
||||
useEffect(function () {
|
||||
onLoad();
|
||||
}, []);
|
||||
if (initStatus !== 'success') {
|
||||
onLoad();
|
||||
}
|
||||
}, [onLoad, initStatus]);
|
||||
|
||||
const iframeStyle = {
|
||||
display: 'none'
|
||||
|
@ -302,7 +304,7 @@ export default class App extends React.Component {
|
|||
<SentryErrorBoundary dsn={this.props.sentryDsn}>
|
||||
<AppContext.Provider value={this.getContextFromState()}>
|
||||
<CommentsBoxContainer done={done} appVersion={this.props.appVersion} />
|
||||
<AuthFrame adminUrl={this.props.adminUrl} onLoad={this.initSetup.bind(this)}/>
|
||||
<AuthFrame adminUrl={this.props.adminUrl} onLoad={this.initSetup.bind(this)} initStatus={this.state.initStatus}/>
|
||||
</AppContext.Provider>
|
||||
</SentryErrorBoundary>
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue