EmbeddedStatus: move history.block() into useEffect
This commit is contained in:
parent
83103294d3
commit
058746103f
1 changed files with 4 additions and 4 deletions
|
@ -26,11 +26,11 @@ const EmbeddedStatus: React.FC<IEmbeddedStatus> = ({ params }) => {
|
||||||
|
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
// Prevent navigation for UX and security.
|
// Prevent navigation for UX and security.
|
||||||
// https://stackoverflow.com/a/71531211
|
// https://stackoverflow.com/a/71531211
|
||||||
history.block();
|
history.block();
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
dispatch(fetchStatus(params.statusId))
|
dispatch(fetchStatus(params.statusId))
|
||||||
.then(() => setLoading(false))
|
.then(() => setLoading(false))
|
||||||
.catch(() => setLoading(false));
|
.catch(() => setLoading(false));
|
||||||
|
|
Loading…
Reference in a new issue