diff --git a/packages/cozy-harvest-lib/src/components/EditAccountModal.jsx b/packages/cozy-harvest-lib/src/components/EditAccountModal.jsx index 3c9dde842b..c0e40c4101 100644 --- a/packages/cozy-harvest-lib/src/components/EditAccountModal.jsx +++ b/packages/cozy-harvest-lib/src/components/EditAccountModal.jsx @@ -95,8 +95,10 @@ const DumbEditAccountModal = withRouter( showError={true} onVaultDismiss={redirectToAccount} fieldOptions={fieldOptions} + reconnect={fromReconnect} /> )} +
) diff --git a/packages/cozy-harvest-lib/src/components/OAuthForm.jsx b/packages/cozy-harvest-lib/src/components/OAuthForm.jsx index db1f36f661..6a8a575664 100644 --- a/packages/cozy-harvest-lib/src/components/OAuthForm.jsx +++ b/packages/cozy-harvest-lib/src/components/OAuthForm.jsx @@ -20,14 +20,12 @@ export class OAuthForm extends PureComponent { this.handleOAuthCancel = this.handleOAuthCancel.bind(this) this.handleExtraParams = this.handleExtraParams.bind(this) this.state = { - initialValues: null, showingOAuthModal: false } } componentDidMount() { const { account, konnector, flow, client } = this.props - this.setState({ initialValues: account ? account.oauth : null }) const konnectorPolicy = findKonnectorPolicy(konnector) @@ -72,30 +70,33 @@ export class OAuthForm extends PureComponent { } render() { - const { konnector, t, flowState } = this.props - const { initialValues, showOAuthWindow, needExtraParams, extraParams } = - this.state + const { konnector, t, flowState, reconnect, account } = this.props + const { showOAuthWindow, needExtraParams, extraParams } = this.state const isBusy = showOAuthWindow === true || flowState.running || (needExtraParams && !extraParams) - return initialValues ? null : ( + const buttonLabel = reconnect ? 'oauth.reconnect.label' : 'oauth.connect.label' + + return ( <>