diff options
Diffstat (limited to 'src/view/com/composer/useExternalLinkFetch.e2e.ts')
-rw-r--r-- | src/view/com/composer/useExternalLinkFetch.e2e.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/view/com/composer/useExternalLinkFetch.e2e.ts b/src/view/com/composer/useExternalLinkFetch.e2e.ts index ccf619db3..65ecb866e 100644 --- a/src/view/com/composer/useExternalLinkFetch.e2e.ts +++ b/src/view/com/composer/useExternalLinkFetch.e2e.ts @@ -1,12 +1,14 @@ -import {useState, useEffect} from 'react' +import {useEffect, useState} from 'react' + +import {useAgent} from '#/state/session' import * as apilib from 'lib/api/index' import {getLinkMeta} from 'lib/link-meta/link-meta' import {ComposerOpts} from 'state/shell/composer' -import {getAgent} from '#/state/session' export function useExternalLinkFetch({}: { setQuote: (opts: ComposerOpts['quote']) => void }) { + const {getAgent} = useAgent() const [extLink, setExtLink] = useState<apilib.ExternalEmbedDraft | undefined>( undefined, ) @@ -39,7 +41,7 @@ export function useExternalLinkFetch({}: { }) } return cleanup - }, [extLink]) + }, [extLink, getAgent]) return {extLink, setExtLink} } |