fix(frontend): default forward speed rule to no limit

Make forward create/edit treat empty speed-limit selection as no limit so the dropdown no longer shows the generic placeholder, and remove announcement console logging to keep frontend lint clean.
This commit is contained in:
sagitchu
2026-02-27 19:37:59 +08:00
parent 6e8406f439
commit a9eac6d01f
3 changed files with 19 additions and 24 deletions
+6 -7
View File
@@ -2349,25 +2349,24 @@ export default function ForwardPage() {
<Select
label="限速规则"
placeholder="不限速"
selectedKeys={
selectedSpeedId !== null
? [selectedSpeedId.toString()]
: ["null"]
: []
}
variant="bordered"
onSelectionChange={(keys) => {
const selectedKey = Array.from(keys)[0] as string;
const selectedKey = Array.from(keys)[0] as
| string
| undefined;
setForm((prev) => ({
...prev,
speedId:
selectedKey === "null" ? null : Number(selectedKey),
speedId: selectedKey ? Number(selectedKey) : null,
}));
}}
>
<SelectItem key="null" textValue="不限速">
不限速
</SelectItem>
{availableSpeedLimits.map((speedLimit) => (
<SelectItem
key={speedLimit.id.toString()}