mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-10-28 11:14:58 +00:00
show reset button after change
This commit is contained in:
@@ -72,6 +72,15 @@ const CustomizationsDialog = ({
|
|||||||
editItem.w &&
|
editItem.w &&
|
||||||
!(editItem.m & DeviceEntityMask.DV_READONLY);
|
!(editItem.m & DeviceEntityMask.DV_READONLY);
|
||||||
|
|
||||||
|
// c is set by the firmware for a saved customization. Mask, name, and edited
|
||||||
|
// limits also count, including changes made in this dialog before they are saved.
|
||||||
|
const showReset =
|
||||||
|
!!editItem.c ||
|
||||||
|
editItem.m !== 0 ||
|
||||||
|
(editItem.cn ?? '') !== '' ||
|
||||||
|
editItem.mi !== editItem.o_mi ||
|
||||||
|
editItem.ma !== editItem.o_ma;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (open) {
|
if (open) {
|
||||||
setError(false);
|
setError(false);
|
||||||
@@ -203,7 +212,7 @@ const CustomizationsDialog = ({
|
|||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
{editItem.c && (
|
{showReset && (
|
||||||
<Button
|
<Button
|
||||||
startIcon={<SettingsBackupRestoreIcon />}
|
startIcon={<SettingsBackupRestoreIcon />}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
|
|||||||
Reference in New Issue
Block a user