re-add link preview

This commit is contained in:
Ren Amamiya
2023-09-04 14:35:57 +07:00
parent 3ebcf4a981
commit c74a81cfdb
8 changed files with 246 additions and 41 deletions

View File

@@ -5,7 +5,7 @@ import { Opengraph } from '@utils/types';
export function useOpenGraph(url: string) {
const { status, data, error } = useQuery(
['preview', url],
['opg', url],
async () => {
const res: Opengraph = await invoke('opengraph', { url });
if (!res) {
@@ -14,10 +14,10 @@ export function useOpenGraph(url: string) {
return res;
},
{
staleTime: Infinity,
refetchOnWindowFocus: false,
refetchOnMount: false,
refetchOnReconnect: false,
staleTime: Infinity,
}
);