mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-06-21 03:41:55 +03:00
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
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:
parent
32daf6f494
commit
620923c27e
@ -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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user