1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-02 07:47:32 +00:00

fix(metadata): apply local operations

This commit is contained in:
renjie-run 2024-10-10 18:18:39 +08:00
parent a669681be9
commit c7b624d91f

View File

@ -111,10 +111,6 @@ class Store {
applyOperation(operation, undoRedoHandler = { handleUndo: true }) {
const { op_type } = operation;
if (LOCAL_APPLY_OPERATION_TYPE.includes(op_type)) {
this.localOperator.applyOperation(operation);
}
if (!NEED_APPLY_AFTER_SERVER_OPERATION.includes(op_type)) {
this.handleUndoRedos(undoRedoHandler, operation);
this.data = deepCopy(operation.apply(this.data));
@ -122,6 +118,11 @@ class Store {
this.context.eventBus.dispatch(EVENT_BUS_TYPE.LOCAL_TABLE_CHANGED);
}
if (LOCAL_APPLY_OPERATION_TYPE.includes(op_type)) {
this.localOperator.applyOperation(operation);
return;
}
this.addPendingOperations(operation, undoRedoHandler);
}