Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
remove commented logs to clean up code
Tom160bd0a79009
diff --git a/src/public/app/widgets/type_widgets/canvas_note.js b/src/public/app/widgets/type_widgets/canvas_note.jsindex bb66e89a3d..7f78da851a 100644--- a/src/public/app/widgets/type_widgets/canvas_note.js+++ b/src/public/app/widgets/type_widgets/canvas_note.js@@ -123,10 +123,8 @@ 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", this.currentNoteId, note.noteId);const noteChanged = this.currentNoteId !== note.noteId;if (noteChanged) {- // this.log("doRefresh resetCurrentSceneVersion = -1");// reset scene to omit unnecessary onchange handlerthis.currentSceneVersion = this.SCENE_VERSION_INITIAL;}@@ -134,13 +132,10 @@ export default class ExcalidrawTypeWidget extends TypeWidget {// get note from backend and put into canvasconst noteComplement = await froca.getNoteComplement(note.noteId);- // this.log('doRefresh', note, noteComplement);- /**- * before we load content into excalidraw, make sure excalidraw has loaded- */+ // before we load content into excalidraw, make sure excalidraw has loadedwhile (!this.excalidrawRef || !this.excalidrawRef.current) {- this.log("excalidrawref not yet loeaded, sleep 200ms...");+ this.log("excalidrawRef not yet loeaded, sleep 200ms...");await sleep(200);}@@ -198,8 +193,6 @@ export default class ExcalidrawTypeWidget extends TypeWidget {fileArray.push(file);}- // this.log("doRefresh(note) sceneData, files", sceneData, files, fileArray);-this.sceneVersion = window.Excalidraw.getSceneVersion(elements);this.excalidrawRef.current.updateScene(sceneData);@@ -264,7 +257,6 @@ export default class ExcalidrawTypeWidget extends TypeWidget {};const contentString = JSON.stringify(content);- // this.log("getContent note size content.svg/content", `~${content.svg.length/1024}kB/${contentString.length/1024}kB`, content.svg.length/contentString.length, "% of svg");return contentString;}@@ -279,7 +271,6 @@ export default class ExcalidrawTypeWidget extends TypeWidget {}onChangeHandler() {- // this.log("onChangeHandler() =================", new Date(), this.isNewSceneVersion());const appState = this.excalidrawRef.current.getAppState() || {};// changeHandler is called upon any tiny change in excalidraw. button clicked, hover, etc.@@ -326,7 +317,6 @@ export default class ExcalidrawTypeWidget extends TypeWidget {width: excalidrawWrapperRef.current.getBoundingClientRect().width,height: excalidrawWrapperRef.current.getBoundingClientRect().height};- // this.log('effect, setdimensions', dimensions);setDimensions(dimensions);const onResize = () => {@@ -334,7 +324,6 @@ export default class ExcalidrawTypeWidget extends TypeWidget {width: excalidrawWrapperRef.current.getBoundingClientRect().width,height: excalidrawWrapperRef.current.getBoundingClientRect().height};- // this.log('onResize, setdimensions', dimensions);setDimensions(dimensions);};@@ -348,11 +337,9 @@ export default class ExcalidrawTypeWidget extends TypeWidget {const { nativeEvent } = event.detail;const isNewTab = nativeEvent.ctrlKey || nativeEvent.metaKey;const isNewWindow = nativeEvent.shiftKey;- const isInternalLink =- link.startsWith("/") || link.includes(window.location.origin);+ const isInternalLink = link.startsWith("/")+ || link.includes(window.location.origin);- // this.log("onLinkOpen", element, event, nativeEvent, "isinternallink", isInternalLink);-if (isInternalLink && !isNewTab && !isNewWindow) {// signal that we're handling the redirect ourselvesevent.preventDefault();@@ -378,7 +365,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget {height: dimensions.height,// initialData: InitialData,onPaste: (data, event) => {- this.log("excalidraw internal paste", data, event);+ this.log("Verbose: excalidraw internal paste. No trilium action implemented.", data, event);},onChange: debounce(this.onChangeHandler, this.DEBOUNCE_TIME_ONCHANGEHANDLER),// onPointerUpdate: (payload) => console.log(payload),