diff --git a/frontend/frontend/src/components/Card/SVG.js b/frontend/frontend/src/components/Card/SVG.js index e1aa2184..6904636a 100644 --- a/frontend/frontend/src/components/Card/SVG.js +++ b/frontend/frontend/src/components/Card/SVG.js @@ -34,6 +34,8 @@ const SvgInline = (props) => { }, [userToken]); useEffect(() => { + let isCurrent = true; + const loadSvg = async () => { process.env.PAT_1 = userToken; @@ -67,10 +69,17 @@ const SvgInline = (props) => { return; } + if (!isCurrent) { + return; + } setSvg(body); setLoaded(true); }; loadSvg(); + + return () => { + isCurrent = false; + }; }, [userToken, isAuthenticated, props.url, props.stage]); useEffect(() => {