mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-06-21 03:41:55 +03:00
clear both detector and model together
This commit is contained in:
parent
32daf6f494
commit
1990aa7156
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user