From 2d42cadb232865290a43c9c89cd94118ace0dcc7 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 20 Sep 2016 15:14:53 +0200 Subject: [PATCH] push /code/ state once ready to avoid OT collision --- www/code/main.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/www/code/main.js b/www/code/main.js index 524726c8a..0f8da6c82 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -35,8 +35,7 @@ define([ }; $(function () { - var userName = Crypto.rand64(8), - toolbar; + var toolbar; var secret = Cryptpad.getSecrets(); @@ -129,10 +128,9 @@ define([ var config = { //initialState: Messages.codeInitialState, - userName: userName, + initialState: '{}', websocketURL: Config.websocketURL, channel: secret.channel, - //cryptKey: key, crypto: Crypto.createEncryptor(secret.key), setMyID: setMyID, transformFunction: JsonOT.validate @@ -549,6 +547,7 @@ define([ initializing = false; //Cryptpad.log("Your document is ready"); + onLocal(); // push local state to avoid parse errors later. getLastName(function (err, lastName) { if (err) { console.log("Could not get previous name");