remove obsolete comments / code

This commit is contained in:
Thomas Frei 2022-04-10 21:49:38 +02:00 committed by Tom
parent cf6b5c3b6e
commit 300f4ad357
3 changed files with 5 additions and 14 deletions

View File

@ -198,7 +198,6 @@ async function setContentPane() {
files: data.files,
}
const svg = await exportToSvg(excData);
console.log("canvas-note revision", data, svg);
$content
.html(
$('<div>')

View File

@ -148,8 +148,6 @@ async function getRenderedContent(note, options = {}) {
const noteComplement = await froca.getNoteComplement(note.noteId);
const content = noteComplement.content || "";
console.log("canvas-note book", note, noteComplement, content);
try {
const data = JSON.parse(content)
const excData = {
@ -161,10 +159,9 @@ async function getRenderedContent(note, options = {}) {
files: data.files,
}
const svg = await exportToSvg(excData);
console.log("canvas-note content book", data, svg);
$renderedContent.append($('<div>').html(svg));
} catch(err) {
console.error("error parsing fullNoteRevision.content as JSON", content, err);
console.error("error parsing content as JSON", content, err);
$renderedContent.append($("<div>").text("Error parsing content. Please check console.error() for more details."));
}
}

View File

@ -131,7 +131,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
*/
async doRefresh(note) {
// see if note changed, since we do not get a new class for a new note
this.log("doRefresh note KKKK", this.currentNoteId, note.noteId);
this.log("doRefresh note", this.currentNoteId, note.noteId);
const noteChanged = this.currentNoteId !== note.noteId;
if (noteChanged) {
this.log("doRefresh resetCurrentSceneVersion = -1");
@ -142,7 +142,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
// get note from backend and put into canvas
const noteComplement = await froca.getNoteComplement(note.noteId);
this.log('doRefresh', note, noteComplement);
// this.log('doRefresh', note, noteComplement);
/**
* before we load content into excalidraw, make sure excalidraw has loaded
@ -152,15 +152,10 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
await sleep(200);
}
/**
* new and empty note
*/
if (this.excalidrawRef.current && noteComplement.content === "") {
}
/**
* load saved content into excalidraw canvas
*/
else if (this.excalidrawRef.current && noteComplement.content) {
if (this.excalidrawRef.current && noteComplement.content) {
try {
const content = JSON.parse(noteComplement.content || "");
@ -245,7 +240,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
time,
};
this.log('getContent()', content, activeFiles);
// this.log('getContent()', content, activeFiles);
return JSON.stringify(content);
}