Skip to content

Commit

Permalink
feat(harvest): Make ConnectionBackdrop global
Browse files Browse the repository at this point in the history
Only for CCC and oauth
  • Loading branch information
acezard committed Mar 10, 2023
1 parent 8f141a7 commit cdd5b22
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/cozy-harvest-lib/src/components/FlowProvider.jsx
Expand Up @@ -4,6 +4,7 @@ import React, { Component } from 'react'
import { withClient } from 'cozy-client'
import { translate } from 'cozy-ui/transpiled/react/I18n'

import ConnectionBackdrop from './AccountForm/ConnectionBackdrop'
import TwoFAModal from './TwoFAModal'
import logger from '../logger'
import ConnectionFlow from '../models/ConnectionFlow'
Expand Down Expand Up @@ -151,21 +152,30 @@ export class FlowProvider extends Component {
}

render() {
const { showTwoFAModal } = this.state
const { showTwoFAModal, flowState } = this.state
const flow = this.flow
const { children } = this.props
const showConnectionBackdrop =
flowState?.running &&
(flow.konnector?.clientSide || flow.konnector?.oauth)

return (
<>
{children({
flow
})}

{showTwoFAModal && (
<TwoFAModal
flow={flow}
dismissAction={this.dismissTwoFAModal}
into="coz-harvest-modal-place"
/>
)}

{showConnectionBackdrop && (
<ConnectionBackdrop name={flow.konnector.name} />
)}
</>
)
}
Expand Down

0 comments on commit cdd5b22

Please sign in to comment.