Skip to content

Commit

Permalink
refactor: Rename variable inside redirectionURL effect
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne committed Sep 18, 2019
1 parent 55c5663 commit bc98c2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/effects.js
Expand Up @@ -2,14 +2,14 @@ import { useEffect, useState } from 'react'
import { Intents } from 'cozy-interapp'

export const useRedirectionURL = (client, doctype, options) => {
const [fetched, setFetched] = useState(null)
const [redirectionURL, setRedirectionURL] = useState(null)
useEffect(() => {
const fetch = async () => {
const intents = new Intents({ client: client })
const fetchedRes = await intents.getRedirectionURL(doctype, options)
setFetched(fetchedRes)
const redirectionURL = await intents.getRedirectionURL(doctype, options)
setRedirectionURL(redirectionURL)
}
fetch()
}, [client.uri, doctype, options])
return fetched
return redirectionURL
}

0 comments on commit bc98c2b

Please sign in to comment.