mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
Make new build weapon select default to "no weapon" rather than Sploosh
This commit is contained in:
parent
136f6f057c
commit
9cd3beca4d
|
|
@ -23,7 +23,7 @@ import {
|
|||
export function useAnalyzeBuild() {
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
|
||||
const mainWeaponId = validatedWeaponIdFromSearchParams(searchParams);
|
||||
const mainWeaponId = validatedWeaponIdFromSearchParams(searchParams) ?? 0;
|
||||
const build = validatedBuildFromSearchParams(searchParams);
|
||||
const build2 = validatedBuildFromSearchParams(searchParams, "build2", build);
|
||||
const ldeIntensity = validatedLdeIntensityFromSearchParams(searchParams);
|
||||
|
|
|
|||
|
|
@ -229,12 +229,15 @@ export function validatedAnyWeaponFromSearchParams(
|
|||
return { type: "MAIN", id: id as MainWeaponId };
|
||||
}
|
||||
|
||||
return { type: "MAIN", id: validatedWeaponIdFromSearchParams(searchParams) };
|
||||
return {
|
||||
type: "MAIN",
|
||||
id: validatedWeaponIdFromSearchParams(searchParams) ?? 0,
|
||||
};
|
||||
}
|
||||
|
||||
export function validatedWeaponIdFromSearchParams(
|
||||
searchParams: URLSearchParams,
|
||||
): MainWeaponId {
|
||||
) {
|
||||
const weaponId = searchParams.get("weapon")
|
||||
? Number(searchParams.get("weapon"))
|
||||
: null;
|
||||
|
|
@ -243,7 +246,7 @@ export function validatedWeaponIdFromSearchParams(
|
|||
return weaponId as MainWeaponId;
|
||||
}
|
||||
|
||||
return weaponCategories[0].weaponIds[0];
|
||||
return null;
|
||||
}
|
||||
|
||||
function validateAbility(
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ function WeaponsSelector() {
|
|||
return (
|
||||
<div key={i} className="stack horizontal sm items-center">
|
||||
<WeaponSelect
|
||||
isRequired
|
||||
onChange={(weaponId) =>
|
||||
setWeapons((weapons) => {
|
||||
const newWeapons = [...weapons];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user