UI: Correct behavior of "back" button on faction augs page

Plus router refactoring
This commit is contained in:
Aleksei Bezrodnov
2023-06-26 10:24:37 +02:00
committed by GitHub
parent 9a0a843ffc
commit 1af01401d9
20 changed files with 173 additions and 201 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ function toLocation(location: Location): void {
} else if (location.name === LocationName.WorldStockExchange) {
Router.toPage(Page.StockMarket);
} else {
Router.toLocation(location);
Router.toPage(Page.Location, { location });
}
}
+2 -3
View File
@@ -151,11 +151,10 @@ export function CompanyLocation(props: IProps): React.ReactElement {
if (!e.isTrusted) {
return;
}
const loc = location;
if (!loc.infiltrationData)
if (!location.infiltrationData)
throw new Error(`trying to start infiltration at ${props.locName} but the infiltrationData is null`);
Router.toInfiltration(loc);
Router.toPage(Page.Infiltration, { location });
}
function work(e: React.MouseEvent<HTMLElement>): void {