FIX: Remove redundant variable

This commit is contained in:
Nicolás Hatcher
2025-01-01 16:08:27 +01:00
committed by Nicolás Hatcher Andrés
parent 9aa1b4574e
commit 70366ea60c

View File

@@ -30,7 +30,6 @@ function NameManagerDialog(properties: NameManagerDialogProperties) {
// If editingNameIndex is -2, then we are not editing any name // If editingNameIndex is -2, then we are not editing any name
// If editingNameIndex is a positive number, then we are editing that index // If editingNameIndex is a positive number, then we are editing that index
const [editingNameIndex, setEditingNameIndex] = useState(-2); const [editingNameIndex, setEditingNameIndex] = useState(-2);
const [showOptions, setShowOptions] = useState(true);
const worksheets = model.getWorksheetsProperties(); const worksheets = model.getWorksheetsProperties();
const definedNameList = model.getDefinedNameList(); const definedNameList = model.getDefinedNameList();
@@ -40,14 +39,6 @@ function NameManagerDialog(properties: NameManagerDialogProperties) {
} }
}, [open]); }, [open]);
useEffect(() => {
if (editingNameIndex !== -2) {
setShowOptions(false);
} else {
setShowOptions(true);
}
}, [editingNameIndex]);
const formatFormula = (): string => { const formatFormula = (): string => {
const worksheetNames = worksheets.map((s) => s.name); const worksheetNames = worksheets.map((s) => s.name);
const selectedView = model.getSelectedView(); const selectedView = model.getSelectedView();
@@ -115,7 +106,7 @@ function NameManagerDialog(properties: NameManagerDialogProperties) {
scope={scopeName} scope={scopeName}
formula={definedName.formula} formula={definedName.formula}
key={definedName.name + definedName.scope} key={definedName.name + definedName.scope}
showOptions={showOptions} showOptions={editingNameIndex === -2}
onEdit={() => setEditingNameIndex(index)} onEdit={() => setEditingNameIndex(index)}
onDelete={() => { onDelete={() => {
model.deleteDefinedName(definedName.name, definedName.scope); model.deleteDefinedName(definedName.name, definedName.scope);