Skip to content

Commit 661539e

Browse files
committed
feat: undo redo icon button
1 parent fa3d6c8 commit 661539e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

packages/vtable-sheet/src/core/table-plugins.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,18 @@ export function getTablePlugins(
4646
!enabledPluginsUserSetted?.some(module => module.module === HistoryPlugin)
4747
) {
4848
const workbookHistory = vtableSheet.getWorkbookHistoryManager();
49-
plugins.push(
50-
new HistoryPlugin({
51-
enableCompression: false,
52-
onTransactionPushed: (args: any) => {
53-
workbookHistory.recordTableTransaction({ sheetKey: args?.sheetKey, tx: args?.tx });
54-
}
55-
})
56-
);
49+
if (typeof HistoryPlugin !== 'function') {
50+
console.warn('HistoryPlugin is not available in @visactor/vtable-plugins');
51+
} else {
52+
plugins.push(
53+
new HistoryPlugin({
54+
enableCompression: false,
55+
onTransactionPushed: (args: any) => {
56+
workbookHistory.recordTableTransaction({ sheetKey: args?.sheetKey, tx: args?.tx });
57+
}
58+
})
59+
);
60+
}
5761
}
5862
if (!disabledPluginsUserSetted?.some(module => module.module === FilterPlugin)) {
5963
const userPluginOptions = enabledPluginsUserSetted?.find(module => module.module === FilterPlugin)

0 commit comments

Comments
 (0)