Skip to content

Commit

Permalink
Fixes after PR
Browse files Browse the repository at this point in the history
  • Loading branch information
demchenkoalex committed Jan 27, 2022
1 parent 8f3b508 commit 16d6892
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/LinkPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ export const LinkPreview = React.memo(

React.useEffect(() => {
let isCancelled = false
if (previewData) return setData(previewData)
if (previewData) {
setData(previewData)
return
}

const fetchData = async () => {
setData(undefined)
const newData = await getPreviewData(text)
Expand Down

0 comments on commit 16d6892

Please sign in to comment.