@powerhousedao/shared 6.2.2-dev.30 → 6.2.2-dev.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3283,7 +3283,7 @@ function baseReducer(document, action, customReducer, dispatch, options = {}) {
|
|
|
3283
3283
|
let reuseLastOperationIndex = false;
|
|
3284
3284
|
const shouldProcessSkipOperation = !ignoreSkipOperations && skipValue > 0;
|
|
3285
3285
|
if (isUndoRedo(_action)) {
|
|
3286
|
-
const { skip: calculatedSkip, action: transformedAction, document: processedDocument, reuseLastOperationIndex: reuseIndex } = processUndoRedo(document, _action, skipValue, options.protocolVersion ??
|
|
3286
|
+
const { skip: calculatedSkip, action: transformedAction, document: processedDocument, reuseLastOperationIndex: reuseIndex } = processUndoRedo(document, _action, skipValue, options.protocolVersion ?? baseReducerVersion(document.header));
|
|
3287
3287
|
_action = transformedAction;
|
|
3288
3288
|
skipValue = calculatedSkip;
|
|
3289
3289
|
newDocument = processedDocument;
|
|
@@ -3299,7 +3299,7 @@ function baseReducer(document, action, customReducer, dispatch, options = {}) {
|
|
|
3299
3299
|
branch
|
|
3300
3300
|
};
|
|
3301
3301
|
newDocument = updateDocument(newDocument, _action, reuseLastOperationIndex, skipValue, operationContext, options.replayOptions?.operation, options.skipIndexValidation);
|
|
3302
|
-
const protocolVersion = options.protocolVersion ??
|
|
3302
|
+
const protocolVersion = options.protocolVersion ?? baseReducerVersion(document.header);
|
|
3303
3303
|
if (isUndo(action) && protocolVersion < 2) return processUndoOperation(newDocument, action.scope, customReducer);
|
|
3304
3304
|
const isNoopWithSkip = _action.type === "NOOP" && skipValue > 0;
|
|
3305
3305
|
if ((isUndo(action) || isNoopWithSkip) && protocolVersion >= 2) {
|