EmbeddedStatus: move history.block() into useEffect

environments/review-embedded-s-jkh70t/deployments/819
Alex Gleason 2022-08-23 10:30:29 -05:00
rodzic 83103294d3
commit 058746103f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -26,11 +26,11 @@ const EmbeddedStatus: React.FC<IEmbeddedStatus> = ({ params }) => {
const [loading, setLoading] = useState(true);
// Prevent navigation for UX and security.
// https://stackoverflow.com/a/71531211
history.block();
useEffect(() => {
// Prevent navigation for UX and security.
// https://stackoverflow.com/a/71531211
history.block();
dispatch(fetchStatus(params.statusId))
.then(() => setLoading(false))
.catch(() => setLoading(false));