fix upgrade/downgrade race condition

This commit is contained in:
martin-mfg
2026-01-06 12:38:30 +01:00
parent fb8dc8a440
commit 2e12a51ffc
@@ -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(() => {