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.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(() => {
|
||||
if (open) {
|
||||
setError(false);
|
||||
@@ -203,7 +212,7 @@ const CustomizationsDialog = ({
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
{editItem.c && (
|
||||
{showReset && (
|
||||
<Button
|
||||
startIcon={<SettingsBackupRestoreIcon />}
|
||||
variant="outlined"
|
||||
|
||||
Reference in New Issue
Block a user