mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
UI fixes (#13030)
* Fix difficulty overwriting export name * Fix NaN for score selector
This commit is contained in:
parent
a75feb7f8f
commit
f9baa3bf20
@ -44,7 +44,7 @@ export default function ExportCard({
|
|||||||
|
|
||||||
const [editName, setEditName] = useState<{
|
const [editName, setEditName] = useState<{
|
||||||
original: string;
|
original: string;
|
||||||
update: string;
|
update?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const submitRename = useCallback(() => {
|
const submitRename = useCallback(() => {
|
||||||
@ -52,7 +52,7 @@ export default function ExportCard({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
onRename(exportedRecording.id, editName.update);
|
onRename(exportedRecording.id, editName.update ?? "");
|
||||||
setEditName(undefined);
|
setEditName(undefined);
|
||||||
}, [editName, exportedRecording, onRename, setEditName]);
|
}, [editName, exportedRecording, onRename, setEditName]);
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ export default function ExportCard({
|
|||||||
modifiers.down &&
|
modifiers.down &&
|
||||||
!modifiers.repeat &&
|
!modifiers.repeat &&
|
||||||
editName &&
|
editName &&
|
||||||
editName.update.length > 0
|
(editName.update?.length ?? 0) > 0
|
||||||
) {
|
) {
|
||||||
submitRename();
|
submitRename();
|
||||||
}
|
}
|
||||||
@ -92,7 +92,11 @@ export default function ExportCard({
|
|||||||
className="mt-3"
|
className="mt-3"
|
||||||
type="search"
|
type="search"
|
||||||
placeholder={editName?.original}
|
placeholder={editName?.original}
|
||||||
value={editName?.update || editName?.original}
|
value={
|
||||||
|
editName?.update == undefined
|
||||||
|
? editName?.original
|
||||||
|
: editName?.update
|
||||||
|
}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setEditName({
|
setEditName({
|
||||||
original: editName.original ?? "",
|
original: editName.original ?? "",
|
||||||
@ -159,7 +163,7 @@ export default function ExportCard({
|
|||||||
onClick={() =>
|
onClick={() =>
|
||||||
setEditName({
|
setEditName({
|
||||||
original: exportedRecording.name,
|
original: exportedRecording.name,
|
||||||
update: "",
|
update: undefined,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
@ -494,12 +494,16 @@ function PlusFilterGroup({
|
|||||||
className="w-12"
|
className="w-12"
|
||||||
inputMode="numeric"
|
inputMode="numeric"
|
||||||
value={Math.round((currentScoreRange?.at(0) ?? 0.5) * 100)}
|
value={Math.round((currentScoreRange?.at(0) ?? 0.5) * 100)}
|
||||||
onChange={(e) =>
|
onChange={(e) => {
|
||||||
|
const value = e.target.value;
|
||||||
|
|
||||||
|
if (value) {
|
||||||
setCurrentScoreRange([
|
setCurrentScoreRange([
|
||||||
parseInt(e.target.value) / 100.0,
|
parseInt(value) / 100.0,
|
||||||
currentScoreRange?.at(1) ?? 1.0,
|
currentScoreRange?.at(1) ?? 1.0,
|
||||||
])
|
]);
|
||||||
}
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<DualThumbSlider
|
<DualThumbSlider
|
||||||
className="w-full"
|
className="w-full"
|
||||||
@ -513,12 +517,16 @@ function PlusFilterGroup({
|
|||||||
className="w-12"
|
className="w-12"
|
||||||
inputMode="numeric"
|
inputMode="numeric"
|
||||||
value={Math.round((currentScoreRange?.at(1) ?? 1.0) * 100)}
|
value={Math.round((currentScoreRange?.at(1) ?? 1.0) * 100)}
|
||||||
onChange={(e) =>
|
onChange={(e) => {
|
||||||
|
const value = e.target.value;
|
||||||
|
|
||||||
|
if (value) {
|
||||||
setCurrentScoreRange([
|
setCurrentScoreRange([
|
||||||
currentScoreRange?.at(0) ?? 0.5,
|
currentScoreRange?.at(0) ?? 0.5,
|
||||||
parseInt(e.target.value) / 100.0,
|
parseInt(value) / 100.0,
|
||||||
])
|
]);
|
||||||
}
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
|
Loading…
Reference in New Issue
Block a user