BUGFIX: Current work is not shown in edge cases (#2208)

This commit is contained in:
catloversg
2025-06-21 01:27:19 +07:00
committed by GitHub
parent 098bf0ffce
commit bebee7b1ef

View File

@@ -194,7 +194,15 @@ export function WorkInProgressRoot(): React.ReactElement {
};
if (Player.currentWork === null) {
setTimeout(() => Router.toPage(Page.Terminal));
setTimeout(() => {
/**
* We must check again before routing to the Terminal page. The player might have started an action right before
* the callback of setTimeout is called.
*/
if (Player.currentWork === null) {
Router.toPage(Page.Terminal);
}
});
return <></>;
}