mirror of
https://github.com/dream-num/univer.git
synced 2026-08-28 23:01:30 +08:00
fix(sheets): ensure the sheet param of InsertSheetMutation are not modified by subsequent operations (#6338)
This commit is contained in:
@@ -19,7 +19,7 @@ import type {
|
||||
IInsertSheetMutationParams,
|
||||
IRemoveSheetMutationParams,
|
||||
} from '../../basics/interfaces/mutation-interface';
|
||||
import { CommandType, IUniverInstanceService } from '@univerjs/core';
|
||||
import { cloneWorksheetData, CommandType, IUniverInstanceService } from '@univerjs/core';
|
||||
|
||||
/**
|
||||
* Generate undo mutation of a `InsertSheetMutation`
|
||||
@@ -53,6 +53,6 @@ export const InsertSheetMutation: IMutation<IInsertSheetMutationParams, boolean>
|
||||
workbook.addStyles(styles);
|
||||
}
|
||||
|
||||
return workbook.addWorksheet(sheet.id, index, sheet);
|
||||
return workbook.addWorksheet(sheet.id, index, cloneWorksheetData(sheet));
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user