fix(import): accept loadouts without GEAR field #2671

Merged
Sainan merged 2 commits from AMelonInsideLemon/SpaceNinjaServer:gear-fix into main 2025-08-21 11:25:51 -07:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 1eff3e8df2 - Show all commits

View File

@ -444,7 +444,7 @@ export const importLoadOutPresets = (db: ILoadoutDatabase, client: ILoadOutPrese
db.NORMAL_PVP = client.NORMAL_PVP.map(convertLoadOutConfig);
db.LUNARO = client.LUNARO.map(convertLoadOutConfig);
db.OPERATOR = client.OPERATOR.map(convertLoadOutConfig);
db.GEAR = client.GEAR ? client.GEAR.map(convertLoadOutConfig) : [];
db.GEAR = client.GEAR?.map(convertLoadOutConfig);
Sainan marked this conversation as resolved Outdated

Why not also make it optional in ILoadoutDatabase so you can simplify this to client.GEAR?.map(convertLoadOutConfig)

Why not also make it optional in `ILoadoutDatabase` so you can simplify this to `client.GEAR?.map(convertLoadOutConfig)`
db.KDRIVE = client.KDRIVE.map(convertLoadOutConfig);
db.DATAKNIFE = client.DATAKNIFE.map(convertLoadOutConfig);
db.MECH = client.MECH.map(convertLoadOutConfig);

View File

@ -79,7 +79,7 @@ export interface ILoadoutDatabase {
NORMAL_PVP: ILoadoutConfigDatabase[];
LUNARO: ILoadoutConfigDatabase[];
OPERATOR: ILoadoutConfigDatabase[];
GEAR: ILoadoutConfigDatabase[];
GEAR?: ILoadoutConfigDatabase[];
KDRIVE: ILoadoutConfigDatabase[];
DATAKNIFE: ILoadoutConfigDatabase[];
MECH: ILoadoutConfigDatabase[];