mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-16 06:03:35 +00:00
fix(metadata): apply local operations
This commit is contained in:
parent
a669681be9
commit
c7b624d91f
@ -111,10 +111,6 @@ class Store {
|
|||||||
applyOperation(operation, undoRedoHandler = { handleUndo: true }) {
|
applyOperation(operation, undoRedoHandler = { handleUndo: true }) {
|
||||||
const { op_type } = operation;
|
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)) {
|
if (!NEED_APPLY_AFTER_SERVER_OPERATION.includes(op_type)) {
|
||||||
this.handleUndoRedos(undoRedoHandler, operation);
|
this.handleUndoRedos(undoRedoHandler, operation);
|
||||||
this.data = deepCopy(operation.apply(this.data));
|
this.data = deepCopy(operation.apply(this.data));
|
||||||
@ -122,6 +118,11 @@ class Store {
|
|||||||
this.context.eventBus.dispatch(EVENT_BUS_TYPE.LOCAL_TABLE_CHANGED);
|
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);
|
this.addPendingOperations(operation, undoRedoHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user