From 4a52ff30ac326275ed7ae1ae18f7540648caa748 Mon Sep 17 00:00:00 2001
From: leccelecce <24962424+leccelecce@users.noreply.github.com>
Date: Mon, 24 Mar 2025 10:41:57 +0000
Subject: [PATCH] Fix config change lost when reloading page
---
.../settings/FrigatePlusSettingsView.tsx | 21 ++++++++++---------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/web/src/views/settings/FrigatePlusSettingsView.tsx b/web/src/views/settings/FrigatePlusSettingsView.tsx
index f5f83d29b..130501eb1 100644
--- a/web/src/views/settings/FrigatePlusSettingsView.tsx
+++ b/web/src/views/settings/FrigatePlusSettingsView.tsx
@@ -122,7 +122,9 @@ export default function FrigatePlusSettingsView({
setIsLoading(true);
axios
- .put(`config/set?model.path=plus://${frigatePlusSettings.model.id}`, {})
+ .put(`config/set?model.path=plus://${frigatePlusSettings.model.id}`, {
+ requires_restart: 0,
+ })
.then((res) => {
if (res.status === 200) {
toast.success(t("frigatePlus.toast.success"), {
@@ -321,15 +323,14 @@ export default function FrigatePlusSettingsView({
}
>
- {(() => {
- const modelId = frigatePlusSettings?.model?.id;
- return modelId &&
- availableModels?.[modelId]?.trainDate
- ? new Date(
- availableModels[modelId].trainDate,
- ).toLocaleString()
- : "Retrieving models...";
- })()}
+ {frigatePlusSettings.model.id &&
+ availableModels?.[frigatePlusSettings.model.id]
+ ? new Date(
+ availableModels[
+ frigatePlusSettings.model.id
+ ].trainDate,
+ ).toLocaleString()
+ : "Retrieving models..."}