clear both detector and model together (#23232)
Some checks are pending
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions

This commit is contained in:
Josh Hawkins 2026-05-18 08:49:25 -05:00 committed by GitHub
parent 32daf6f494
commit 620923c27e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -373,27 +373,15 @@ export default function DetectorsAndModelSettingsView({
setIsSaving(true); setIsSaving(true);
try { try {
if (tabChanged) { // Pre-clear both `detectors` and `model` together when a renaming
// Best-effort cleanup of the prior model's fields if (tabChanged || detectorKeysChanged) {
try { try {
await axios.put("config/set", { await axios.put("config/set", {
requires_restart: 0, requires_restart: 0,
config_data: { model: null }, config_data: { detectors: null, model: null },
}); });
} catch { } catch {
// intentional no-op — see comment above // best-effort cleanup
}
}
if (detectorKeysChanged) {
// Best-effort cleanup
try {
await axios.put("config/set", {
requires_restart: 0,
config_data: { detectors: null },
});
} catch {
// intentional no-op — see comment above
} }
} }