clear both detector and model together

This commit is contained in:
Josh Hawkins 2026-05-18 08:40:49 -05:00
parent 32daf6f494
commit 1990aa7156

View File

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