Trigger an onReady() method when the user's pad is fully synced (the history is loaded)

This commit is contained in:
Yann Flory
2016-03-16 14:00:14 +01:00
parent eca4ec699c
commit e77d85bc82
4 changed files with 32 additions and 20 deletions

View File

@@ -158,11 +158,9 @@ define([
// apply patches, and try not to lose the cursor in the process!
var applyHjson = function (shjson) {
var hjson = JSON.parse(shjson);
console.log(hjson);
var peerUserList = hjson[hjson.length-1];
if(peerUserList.mydata) {
var userData = peerUserList.mydata;
console.log(userData);
addToUserList(userData);
delete hjson[hjson.length-1];
}