diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 93d36922..430b269c 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -93,7 +93,7 @@ } }, "security": { - "csp": null + "csp": "upgrade-insecure-requests" }, "updater": { "active": true, diff --git a/src/utils/hooks/useProfileMetadata.tsx b/src/utils/hooks/useProfileMetadata.tsx index b2fa45fb..c64d108b 100644 --- a/src/utils/hooks/useProfileMetadata.tsx +++ b/src/utils/hooks/useProfileMetadata.tsx @@ -38,7 +38,9 @@ export const useProfileMetadata = (pubkey: string) => { }, []); useEffect(() => { - if (!cacheProfile) { + let ignore = false; + + if (!cacheProfile && !ignore) { fetchProfileMetadata(pubkey) .then((res: any) => { // update state @@ -48,6 +50,10 @@ export const useProfileMetadata = (pubkey: string) => { }) .catch(console.error); } + + return () => { + ignore = true; + }; }, [cacheProfile, insertPlebToDB, pubkey]); if (cacheProfile) {