This commit is contained in:
Ren Amamiya
2023-06-25 20:36:19 +07:00
parent fe25dbaed0
commit 6af0b453e3
25 changed files with 183 additions and 114 deletions

View File

@@ -5,7 +5,11 @@ export function useOpenGraph(url: string) {
const { status, data, error, isFetching } = useQuery(
["preview", url],
async () => {
return await getLinkPreview(url);
const res = await getLinkPreview(url);
if (!res) {
throw new Error("Can' fetch");
}
return res;
},
{
refetchOnWindowFocus: false,