Skip to content
Snippets Groups Projects
Commit 8def3fb7 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

chore: fix modal after loading

parent 38e495c1
No related branches found
No related tags found
1 merge request!11623.0 Release
......@@ -209,7 +209,6 @@ const KonnectorViewerCard = ({
}
dispatch(setShowConnectionDetails(false))
setOpenModal(false)
// TODO null state seems to be read before modal closing and display a success icon in modal
setKonnectorState(null)
setKonnectorErrorDescription(null)
},
......@@ -294,16 +293,19 @@ const KonnectorViewerCard = ({
fluidConnection: updatedConnection,
})
)
Promise.all([
const [, updatedFluidStatus] = await Promise.all([
await refreshChallengeState(),
await updateGlobalFluidStatus(),
])
setKonnectorState(_state)
/** If waiting for consent, close Konnector modal */
if (isWaitingForConsent) {
/** If waiting for consent, close Konnector modal first and handle connection closed */
if (
updatedFluidStatus[2].connection.triggerState?.last_error ===
KonnectorError.CHALLENGE_ASKED
) {
setOpenModal(false)
setKonnectorState(null)
handleConnectionEnd(false)
}
}
},
......@@ -311,7 +313,7 @@ const KonnectorViewerCard = ({
currentFluidStatus.connection,
currentFluidStatus.fluidType,
dispatch,
isWaitingForConsent,
handleConnectionEnd,
refreshChallengeState,
updateGlobalFluidStatus,
]
......
......@@ -19,7 +19,6 @@ export default class FluidService {
konnector: Konnector | null,
state: TriggerState | null
): FluidState => {
console.log('🚀 ~ FluidService ~ state:', state)
if (!konnector) return FluidState.KONNECTOR_NOT_FOUND
if (!state) return FluidState.NOT_CONNECTED
switch (state.status) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment