Send the initial state only if it is a new pad in /pad

pull/1/head
yflory 8 years ago
parent 66dc166936
commit d4bf7cf9aa

@ -130,7 +130,7 @@ define([
$(inner).css({
color: '#fff',
});
documentBody.innerHTML = Messages.initialState;
//documentBody.innerHTML = Messages.initialState;
var cursor = window.cursor = Cursor(inner);
@ -367,7 +367,8 @@ define([
var realtimeOptions = {
// provide initialstate...
initialState: stringifyDOM(inner) || '{}',
//initialState: stringifyDOM(inner) || '{}',
initialState: '[]',
// the websocket URL
websocketURL: Cryptpad.getWebsocketURL(),
@ -675,6 +676,11 @@ define([
module.realtime = info.realtime;
var shjson = info.realtime.getUserDoc();
var newPad = false;
if (shjson === '[]') { newPad = true; }
if (!newPad) {
applyHjson(shjson);
// Update the user list (metadata) from the hyperjson
@ -697,6 +703,10 @@ define([
throw new Error();
}
}
} else {
updateMetadata(shjson);
documentBody.innerHTML = Messages.initialState;
}
Cryptpad.getLastName(function (err, lastName) {
console.log("Unlocking editor");

Loading…
Cancel
Save