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.

chore: fix incorrect logical expressions (#6627)

wpxp1234563acc9e36c99f
diff --git a/packages/sheets/src/facade/f-univer.ts b/packages/sheets/src/facade/f-univer.ts
index a4db4d07d7..7d725c44d6 100644
--- a/packages/sheets/src/facade/f-univer.ts
+++ b/packages/sheets/src/facade/f-univer.ts
@@ -449,9 +449,10 @@ export class FUniverSheetsMixin extends FUniver implements IFUniverSheetsMixin {
if (commandInfo.id === ToggleGridlinesCommand.id) {
const target = this.getCommandSheetTarget(commandInfo);
if (!target) return;
+ const showGridlines = (commandInfo.params as IToggleGridlinesCommandParams)?.showGridlines ?? !target.worksheet.hasHiddenGridLines();
const eventParams: IBeforeGridlineEnableChange = {
...target,
- enabled: Boolean((commandInfo.params as IToggleGridlinesCommandParams)?.showGridlines) ?? !target.worksheet.hasHiddenGridLines(),
+ enabled: Boolean(showGridlines),
};
this.fireEvent(this.Event.BeforeGridlineEnableChange, eventParams);
// cancel this command