persist whiteboard content across sessions
This commit is contained in:
parent
748172585e
commit
9571b3c018
@ -433,6 +433,7 @@ define([
|
|||||||
|
|
||||||
var userDoc = APP.realtime.getUserDoc();
|
var userDoc = APP.realtime.getUserDoc();
|
||||||
var isNew = false;
|
var isNew = false;
|
||||||
|
var newDoc = '';
|
||||||
if (userDoc === "" || userDoc === "{}") { isNew = true; }
|
if (userDoc === "" || userDoc === "{}") { isNew = true; }
|
||||||
|
|
||||||
if (userDoc !== "") {
|
if (userDoc !== "") {
|
||||||
@ -448,15 +449,19 @@ define([
|
|||||||
Cryptpad.errorLoadingScreen(errorText);
|
Cryptpad.errorLoadingScreen(errorText);
|
||||||
throw new Error(errorText);
|
throw new Error(errorText);
|
||||||
}
|
}
|
||||||
|
newDoc = hjson.content;
|
||||||
} else {
|
} else {
|
||||||
Title.updateTitle(Cryptpad.initialName || Title.defaultTitle);
|
Title.updateTitle(Cryptpad.initialName || Title.defaultTitle);
|
||||||
}
|
}
|
||||||
|
if (newDoc) {
|
||||||
|
canvas.loadFromJSON(newDoc);
|
||||||
|
canvas.renderAll();
|
||||||
|
}
|
||||||
|
|
||||||
Cryptpad.removeLoadingScreen();
|
|
||||||
setEditable(!readOnly);
|
setEditable(!readOnly);
|
||||||
initializing = false;
|
initializing = false;
|
||||||
config.onLocal();
|
config.onLocal();
|
||||||
|
Cryptpad.removeLoadingScreen();
|
||||||
if (readOnly) { return; }
|
if (readOnly) { return; }
|
||||||
if (isNew) {
|
if (isNew) {
|
||||||
common.openTemplatePicker();
|
common.openTemplatePicker();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user