Skip to content

Build your personal knowledge base with Trilium Notes

chore(client): remove unnecessary logs

Elian Doran1de9634c4435
diff --git a/apps/client/src/widgets/collections/NoteList.tsx b/apps/client/src/widgets/collections/NoteList.tsx
index 98d9a3febf..63eb64a993 100644
--- a/apps/client/src/widgets/collections/NoteList.tsx
+++ b/apps/client/src/widgets/collections/NoteList.tsx
@@ -123,7 +123,6 @@ function useNoteIds(note: FNote | null | undefined, viewType: ViewTypeOptions |
}
async function getNoteIds(note: FNote) {
- console.log("Refreshed note IDs");
if (viewType === "list" || viewType === "grid") {
return note.getChildNoteIds();
} else {
diff --git a/apps/client/src/widgets/collections/geomap/map.tsx b/apps/client/src/widgets/collections/geomap/map.tsx
index faf2ec654d..da9c2173bd 100644
--- a/apps/client/src/widgets/collections/geomap/map.tsx
+++ b/apps/client/src/widgets/collections/geomap/map.tsx
@@ -68,7 +68,6 @@ export default function Map({ coordinates, zoom, layerName, viewportChanged, chi
useEffect(() => {
const map = mapRef.current;
const layerToAdd = layer;
- console.log("Add layer ", map, layerToAdd);
if (!map || !layerToAdd) return;
layerToAdd.addTo(map);
return () => layerToAdd.removeFrom(map);
diff --git a/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx b/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx
index 08241f9316..32cae708b3 100644
--- a/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx
+++ b/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx
@@ -132,7 +132,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
if (htmlAttrs.length > 0) {
htmlAttrs += " ";
- }
+ }
editorRef.current?.setText(htmlAttrs);
setCurrentValue(htmlAttrs);
@@ -233,7 +233,6 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
useEffect(() => refresh(), [ note ]);
useTriliumEvent("entitiesReloaded", ({ loadResults }) => {
if (loadResults.getAttributeRows(componentId).find((attr) => attributes.isAffecting(attr, note))) {
- console.log("Trigger due to entities reloaded");
refresh();
}
});
@@ -262,8 +261,8 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
}
return result?.note?.getBestNotePathString();
- }
- }), [ notePath ]));
+ }
+ }), [ notePath ]));
// Keyboard shortcuts
useTriliumEvent("addNewLabel", ({ ntxId: eventNtxId }) => {
@@ -281,7 +280,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
refresh,
renderOwnedAttributes: (attributes) => renderOwnedAttributes(attributes as FAttribute[], false)
}), [ save, refresh, renderOwnedAttributes ]);
-
+
return (
<>
{!hidden && <div
@@ -292,7 +291,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
if (isIMEComposing(e)) {
return;
}
-
+
if (e.key === "Enter") {
// allow autocomplete to fill the result textarea
setTimeout(() => save(), 100);
@@ -313,9 +312,9 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
}}
onChange={(currentValue) => {
currentValueRef.current = currentValue ?? "";
-
+
const oldValue = getPreprocessedData(lastSavedContent.current ?? "").trimEnd();
- const newValue = getPreprocessedData(currentValue ?? "").trimEnd();
+ const newValue = getPreprocessedData(currentValue ?? "").trimEnd();
setNeedsSaving(oldValue !== newValue);
setError(undefined);
}}
@@ -351,7 +350,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
x: e.pageX,
y: e.pageY
});
- setState("showAttributeDetail");
+ setState("showAttributeDetail");
} else {
setState("showHelpTooltip");
}
@@ -373,7 +372,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
onClick={save}
/> }
- <ActionButton
+ <ActionButton
icon="bx bx-plus"
className="add-new-attribute-button tn-tool-button"
text={escapeQuotes(t("attribute_editor.add_a_new_attribute"))}
@@ -407,7 +406,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
{attributeDetailWidgetEl}
</>
- )
+ )
}
function getPreprocessedData(currentValue: string) {