From 300f4ad35774505d96e5abd94b67c6e965c46a26 Mon Sep 17 00:00:00 2001 From: Thomas Frei <7283497+thfrei@users.noreply.github.com> Date: Sun, 10 Apr 2022 21:49:38 +0200 Subject: [PATCH] remove obsolete comments / code --- src/public/app/dialogs/note_revisions.js | 1 - src/public/app/services/note_content_renderer.js | 5 +---- src/public/app/widgets/type_widgets/canvas_note.js | 13 ++++--------- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/public/app/dialogs/note_revisions.js b/src/public/app/dialogs/note_revisions.js index e8992058a..52642f580 100644 --- a/src/public/app/dialogs/note_revisions.js +++ b/src/public/app/dialogs/note_revisions.js @@ -198,7 +198,6 @@ async function setContentPane() { files: data.files, } const svg = await exportToSvg(excData); - console.log("canvas-note revision", data, svg); $content .html( $('
') diff --git a/src/public/app/services/note_content_renderer.js b/src/public/app/services/note_content_renderer.js index 93bd0d267..c20ee9ca0 100644 --- a/src/public/app/services/note_content_renderer.js +++ b/src/public/app/services/note_content_renderer.js @@ -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($('
').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($("
").text("Error parsing content. Please check console.error() for more details.")); } } diff --git a/src/public/app/widgets/type_widgets/canvas_note.js b/src/public/app/widgets/type_widgets/canvas_note.js index 9cf5c9746..3c594dbd8 100644 --- a/src/public/app/widgets/type_widgets/canvas_note.js +++ b/src/public/app/widgets/type_widgets/canvas_note.js @@ -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); }