upgrade to most recent chainpad

This commit is contained in:
Caleb James DeLisle 2015-01-30 16:41:01 +01:00
parent 8c614f6b25
commit e039e90a24
1 changed files with 10 additions and 8 deletions

View File

@ -1093,14 +1093,16 @@ var handleMessage = ChainPad.handleMessage = function (realtime, msgStr) {
Common.assert(newUserInterfaceContent === realtime.userInterfaceContent);
}
// push the uncommittedPatch out to the user interface.
for (var i = 0; i < realtime.patchHandlers.length; i++) {
realtime.patchHandlers[i](uncommittedPatch);
}
if (realtime.opHandlers.length) {
for (var i = uncommittedPatch.operations.length-1; i >= 0; i--) {
for (var j = 0; j < realtime.opHandlers.length; j++) {
realtime.opHandlers[j](uncommittedPatch.operations[i]);
if (uncommittedPatch.operations.length) {
// push the uncommittedPatch out to the user interface.
for (var i = 0; i < realtime.patchHandlers.length; i++) {
realtime.patchHandlers[i](uncommittedPatch);
}
if (realtime.opHandlers.length) {
for (var i = uncommittedPatch.operations.length-1; i >= 0; i--) {
for (var j = 0; j < realtime.opHandlers.length; j++) {
realtime.opHandlers[j](uncommittedPatch.operations[i]);
}
}
}
}