mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
https://github.com/dcs-liberation/dcs_liberation/issues/2039 Partial fix for https://github.com/dcs-liberation/dcs_liberation/issues/2045 (now works in the new map, old one not fixed yet).
17 lines
555 B
TypeScript
17 lines
555 B
TypeScript
import reloadGameState from "../api/gamestate";
|
|
import { useAppDispatch } from "../app/hooks";
|
|
import { useEffect } from "react";
|
|
|
|
// TODO: This should probably be distinct useControlPoints, useFlights, etc that
|
|
// are smart enough to only initialize once which get called in the components
|
|
// that use them rather than forcibly loading the whole game in the root
|
|
// component.
|
|
export const useInitialGameState = () => {
|
|
const dispatch = useAppDispatch();
|
|
useEffect(() => {
|
|
reloadGameState(dispatch);
|
|
});
|
|
};
|
|
|
|
export default useInitialGameState;
|