mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-04-29 08:16:22 +00:00
enable React Compiler, add linter
This commit is contained in:
parent
f0e34caa25
commit
0c6aa3b4dd
59 changed files with 5802 additions and 1831 deletions
3
app/global.d.ts
vendored
3
app/global.d.ts
vendored
|
|
@ -1,9 +1,8 @@
|
|||
import type { Dispatch, SetStateAction } from "react";
|
||||
import type { getMissionList, getMissionInfo } from "@/src/manifest";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
setMissionName?: Dispatch<SetStateAction<string>>;
|
||||
setMissionName?: (missionName: string) => void;
|
||||
getMissionList?: typeof getMissionList;
|
||||
getMissionInfo?: typeof getMissionInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,12 +38,13 @@ const defaultMission: CurrentMission = {
|
|||
|
||||
const parseAsMissionWithType = createParser<CurrentMission>({
|
||||
parse(query: string) {
|
||||
let [missionName, missionType] = query.split("~");
|
||||
const [missionName, missionType] = query.split("~");
|
||||
let selectedMissionType = missionType;
|
||||
const availableMissionTypes = getMissionInfo(missionName).missionTypes;
|
||||
if (!missionType || !availableMissionTypes.includes(missionType)) {
|
||||
missionType = availableMissionTypes[0];
|
||||
selectedMissionType = availableMissionTypes[0];
|
||||
}
|
||||
return { missionName, missionType };
|
||||
return { missionName, missionType: selectedMissionType };
|
||||
},
|
||||
serialize({ missionName, missionType }): string {
|
||||
const availableMissionTypes = getMissionInfo(missionName).missionTypes;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue