Skip to content

Commit

Permalink
fix: Force the update of the current konnector data
Browse files Browse the repository at this point in the history
To be sure to have updated konnector fields displayed to the user.
This is a step backward regarding time optimization but we need to be
sure to have updated konnector fields or this can lead to block
konnector errors.
  • Loading branch information
doubleface committed Dec 18, 2024
1 parent 7c56591 commit 8e6bc7b
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ export const useKonnectorWithTriggers = (slug, injectedKonnector) => {

useEffect(() => {
async function load() {
// need to do getKonnector anyway to force the update of the konnector to be
// sur to have updated konnector fields
const konnector = await getKonnector(client, slug)
setKonnector(konnector)
if (injectedKonnector) {
setKonnector(injectedKonnector)
setTriggers(injectedKonnector.triggers)
} else {
const [konnector, triggers] = await Promise.all([
getKonnector(client, slug),
getTriggers(client, slug)
])
setKonnector(konnector)
const triggers = await getTriggers(client, slug)
setTriggers({ data: triggers })
}
setIsFetching(false)
Expand Down

0 comments on commit 8e6bc7b

Please sign in to comment.