Skip to content

Commit

Permalink
fix(conditional-formatting): add onlyLocal to formula mutations (#4323)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gggpound authored Dec 25, 2024
1 parent fc17973 commit 80e6f37
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import type { IConditionalFormattingFormulaMarkDirtyParams } from '../commands/m
import type { IConditionalFormattingRuleConfig } from '../models/type';

import { BooleanNumber, CellValueType, Disposable, ICommandService, Inject, ObjectMatrix, RefAlias, Tools } from '@univerjs/core';
import { IActiveDirtyManagerService,
import {
IActiveDirtyManagerService,
RemoveOtherFormulaMutation,
SetFormulaCalculationResultMutation,
SetOtherFormulaMutation,
Expand Down Expand Up @@ -203,16 +204,16 @@ export class ConditionalFormattingFormulaService extends Disposable {
},
};

this._commandService.executeCommand(SetOtherFormulaMutation.id, params).then(() => {
this._commandService.executeCommand(SetOtherFormulaMutation.id, params, { onlyLocal: true }).then(() => {
this._commandService.executeCommand(ConditionalFormattingFormulaMarkDirty.id,
{ [unitId]: { [subUnitId]: { [formulaId]: true } } });
{ [unitId]: { [subUnitId]: { [formulaId]: true } } }, { onlyLocal: true });
});
}

private _removeFormulaByCfId(unitId: string, subUnitId: string, cfId: string) {
const values = this.deleteCache(unitId, subUnitId, cfId);
const formulaIdList = values.map((item) => item.formulaId);
this._commandService.executeCommand(RemoveOtherFormulaMutation.id, { unitId, subUnitId, formulaIdList } as IRemoveOtherFormulaMutationParams);
this._commandService.executeCommand(RemoveOtherFormulaMutation.id, { unitId, subUnitId, formulaIdList } as IRemoveOtherFormulaMutationParams, { onlyLocal: true });
}

public getFormulaResultWithCoords(unitId: string, subUnitId: string, cfId: string, formulaText: string, row: number = 0, col: number = 0) {
Expand Down

0 comments on commit 80e6f37

Please sign in to comment.