fix(api): fix setTabColor API was not working when setting inactive worksheets (#6395)

This commit is contained in:
wpxp123456
2025-12-27 20:30:51 +08:00
committed by GitHub
parent 7f1adc51eb
commit 57c51eea58
@@ -16,12 +16,12 @@
import type { IAccessor, ICommand } from '@univerjs/core';
import type { ISetTabColorMutationParams } from '../mutations/set-tab-color.mutation';
import type { ISheetCommandSharedParams } from '../utils/interface';
import { CommandType, ICommandService, IUndoRedoService, IUniverInstanceService } from '@univerjs/core';
import { SetTabColorMutation, SetTabColorUndoMutationFactory } from '../mutations/set-tab-color.mutation';
import { getSheetCommandTarget } from './utils/target-util';
export interface ISetTabColorCommandParams {
export interface ISetTabColorCommandParams extends Partial<ISheetCommandSharedParams> {
value: string;
}
@@ -33,7 +33,7 @@ export const SetTabColorCommand: ICommand = {
const commandService = accessor.get(ICommandService);
const undoRedoService = accessor.get(IUndoRedoService);
const target = getSheetCommandTarget(accessor.get(IUniverInstanceService));
const target = getSheetCommandTarget(accessor.get(IUniverInstanceService), params);
if (!target) return false;
const { unitId, subUnitId } = target;