fix: crash when geo-update-interval is null in config

This commit is contained in:
zjdndjf
2026-08-17 10:54:12 +08:00
parent 41c2f26538
commit fca31a84b3

View File

@@ -148,10 +148,12 @@ const GeoData: React.FC = () => {
<Input
size="sm"
type="number"
className="w-[100px]"
value={geoUpdateInterval.toString()}
className="w-25"
value={(geoUpdateInterval ?? 24).toString()}
onValueChange={(v) => {
patchControledMihomoConfig({ 'geo-update-interval': parseInt(v) })
const nextInterval = parseInt(v)
if (Number.isNaN(nextInterval)) return
patchControledMihomoConfig({ 'geo-update-interval': nextInterval })
}}
/>
</SettingItem>