mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-03-29 08:43:41 -04:00
fix #257
Apparently a `MenuItem` with a value of `undefined` is possible but doesn't actually fire a change event. Strange. Use the string `"null"` instead.
This commit is contained in:
parent
64d161d0a7
commit
015dfef9c9
@ -32,6 +32,8 @@ even on minor releases, e.g. `0.7.5` -> `0.7.6`.
|
|||||||
* first draft of a web UI for user administration. Rough edges expected!
|
* first draft of a web UI for user administration. Rough edges expected!
|
||||||
* `moonfire-nvr login --permissions` now accepts the JSON format documented
|
* `moonfire-nvr login --permissions` now accepts the JSON format documented
|
||||||
in `ref/api.md`, not an undocumented plaintext protobuf format.
|
in `ref/api.md`, not an undocumented plaintext protobuf format.
|
||||||
|
* fix [#257](https://github.com/scottlamb/moonfire-nvr/issues/257):
|
||||||
|
Live View: select None Not Possible After Selecting a Camera.
|
||||||
|
|
||||||
## 0.7.5 (2022-05-09)
|
## 0.7.5 (2022-05-09)
|
||||||
|
|
||||||
|
@ -214,17 +214,17 @@ interface MonoviewProps {
|
|||||||
|
|
||||||
/** A single pane of a Multiview, including its camera chooser. */
|
/** A single pane of a Multiview, including its camera chooser. */
|
||||||
const Monoview = (props: MonoviewProps) => {
|
const Monoview = (props: MonoviewProps) => {
|
||||||
const handleChange = (event: SelectChangeEvent<number | null>) => {
|
const handleChange = (event: SelectChangeEvent<string>) => {
|
||||||
const {
|
const {
|
||||||
target: { value },
|
target: { value },
|
||||||
} = event;
|
} = event;
|
||||||
|
|
||||||
props.onSelect(typeof value === "string" ? parseInt(value) : value);
|
props.onSelect(value === "null" ? null : parseInt(value));
|
||||||
};
|
};
|
||||||
|
|
||||||
const chooser = (
|
const chooser = (
|
||||||
<Select
|
<Select
|
||||||
value={props.cameraIndex == null ? undefined : props.cameraIndex}
|
value={props.cameraIndex === null ? "null" : props.cameraIndex.toString()}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
displayEmpty
|
displayEmpty
|
||||||
size="small"
|
size="small"
|
||||||
@ -236,7 +236,7 @@ const Monoview = (props: MonoviewProps) => {
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MenuItem value={undefined}>(none)</MenuItem>
|
<MenuItem value="null">(none)</MenuItem>
|
||||||
{props.cameras.map((e, i) => (
|
{props.cameras.map((e, i) => (
|
||||||
<MenuItem key={i} value={i}>
|
<MenuItem key={i} value={i}>
|
||||||
{e.shortName}
|
{e.shortName}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user