Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(facade): calculate the correct number of displayable sheet (#4335)

Gpound.liu7fcb50ad4d6a
diff --git a/packages/sheets/src/facade/f-worksheet.ts b/packages/sheets/src/facade/f-worksheet.ts
index 47541d2fb3..fde7ccad40 100644
--- a/packages/sheets/src/facade/f-worksheet.ts
+++ b/packages/sheets/src/facade/f-worksheet.ts
@@ -1376,7 +1376,7 @@ export class FWorksheet extends FBase {
const commandService = this._injector.get(ICommandService);
const workbook = this._workbook;
const sheets = workbook.getSheets();
- const visibleSheets = sheets.filter((sheet) => sheet.isSheetHidden() === BooleanNumber.TRUE);
+ const visibleSheets = sheets.filter((sheet) => sheet.isSheetHidden() !== BooleanNumber.TRUE);
if (visibleSheets.length <= 1) {
throw new Error('Cannot hide the only visible sheet');
}