FIX: It it possible to have DF scoped to the first sheet

This commit is contained in:
Nicolás Hatcher
2025-02-18 23:44:10 +01:00
committed by Nicolás Hatcher Andrés
parent a10d1f4615
commit 5aa7617e97
2 changed files with 32 additions and 4 deletions

View File

@@ -98,9 +98,10 @@ function NameManagerDialog(properties: NameManagerDialogProperties) {
) : (
<NameListWrapper>
{definedNameList.map((definedName, index) => {
const scopeName = definedName.scope
? worksheets[definedName.scope].name
: "[global]";
const scopeName =
definedName.scope !== undefined
? worksheets[definedName.scope].name
: "[global]";
if (index === editingNameIndex) {
return (
<NamedRangeActive
@@ -117,7 +118,7 @@ function NameManagerDialog(properties: NameManagerDialogProperties) {
const scope_index = worksheets.findIndex(
(s) => s.name === newScope,
);
const scope = scope_index > 0 ? scope_index : undefined;
const scope = scope_index >= 0 ? scope_index : undefined;
try {
updateDefinedName(
definedName.name,