mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
chore(client): remove unnecessary logs
This commit is contained in:
parent
d36716bdb6
commit
1de9634c44
@ -123,7 +123,6 @@ function useNoteIds(note: FNote | null | undefined, viewType: ViewTypeOptions |
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getNoteIds(note: FNote) {
|
async function getNoteIds(note: FNote) {
|
||||||
console.log("Refreshed note IDs");
|
|
||||||
if (viewType === "list" || viewType === "grid") {
|
if (viewType === "list" || viewType === "grid") {
|
||||||
return note.getChildNoteIds();
|
return note.getChildNoteIds();
|
||||||
} else {
|
} else {
|
||||||
|
@ -68,7 +68,6 @@ export default function Map({ coordinates, zoom, layerName, viewportChanged, chi
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const map = mapRef.current;
|
const map = mapRef.current;
|
||||||
const layerToAdd = layer;
|
const layerToAdd = layer;
|
||||||
console.log("Add layer ", map, layerToAdd);
|
|
||||||
if (!map || !layerToAdd) return;
|
if (!map || !layerToAdd) return;
|
||||||
layerToAdd.addTo(map);
|
layerToAdd.addTo(map);
|
||||||
return () => layerToAdd.removeFrom(map);
|
return () => layerToAdd.removeFrom(map);
|
||||||
|
@ -132,7 +132,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
|
|||||||
|
|
||||||
if (htmlAttrs.length > 0) {
|
if (htmlAttrs.length > 0) {
|
||||||
htmlAttrs += " ";
|
htmlAttrs += " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
editorRef.current?.setText(htmlAttrs);
|
editorRef.current?.setText(htmlAttrs);
|
||||||
setCurrentValue(htmlAttrs);
|
setCurrentValue(htmlAttrs);
|
||||||
@ -233,7 +233,6 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
|
|||||||
useEffect(() => refresh(), [ note ]);
|
useEffect(() => refresh(), [ note ]);
|
||||||
useTriliumEvent("entitiesReloaded", ({ loadResults }) => {
|
useTriliumEvent("entitiesReloaded", ({ loadResults }) => {
|
||||||
if (loadResults.getAttributeRows(componentId).find((attr) => attributes.isAffecting(attr, note))) {
|
if (loadResults.getAttributeRows(componentId).find((attr) => attributes.isAffecting(attr, note))) {
|
||||||
console.log("Trigger due to entities reloaded");
|
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -262,8 +261,8 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
|
|||||||
}
|
}
|
||||||
|
|
||||||
return result?.note?.getBestNotePathString();
|
return result?.note?.getBestNotePathString();
|
||||||
}
|
}
|
||||||
}), [ notePath ]));
|
}), [ notePath ]));
|
||||||
|
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
useTriliumEvent("addNewLabel", ({ ntxId: eventNtxId }) => {
|
useTriliumEvent("addNewLabel", ({ ntxId: eventNtxId }) => {
|
||||||
@ -281,7 +280,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
|
|||||||
refresh,
|
refresh,
|
||||||
renderOwnedAttributes: (attributes) => renderOwnedAttributes(attributes as FAttribute[], false)
|
renderOwnedAttributes: (attributes) => renderOwnedAttributes(attributes as FAttribute[], false)
|
||||||
}), [ save, refresh, renderOwnedAttributes ]);
|
}), [ save, refresh, renderOwnedAttributes ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!hidden && <div
|
{!hidden && <div
|
||||||
@ -292,7 +291,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
|
|||||||
if (isIMEComposing(e)) {
|
if (isIMEComposing(e)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
// allow autocomplete to fill the result textarea
|
// allow autocomplete to fill the result textarea
|
||||||
setTimeout(() => save(), 100);
|
setTimeout(() => save(), 100);
|
||||||
@ -313,9 +312,9 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
|
|||||||
}}
|
}}
|
||||||
onChange={(currentValue) => {
|
onChange={(currentValue) => {
|
||||||
currentValueRef.current = currentValue ?? "";
|
currentValueRef.current = currentValue ?? "";
|
||||||
|
|
||||||
const oldValue = getPreprocessedData(lastSavedContent.current ?? "").trimEnd();
|
const oldValue = getPreprocessedData(lastSavedContent.current ?? "").trimEnd();
|
||||||
const newValue = getPreprocessedData(currentValue ?? "").trimEnd();
|
const newValue = getPreprocessedData(currentValue ?? "").trimEnd();
|
||||||
setNeedsSaving(oldValue !== newValue);
|
setNeedsSaving(oldValue !== newValue);
|
||||||
setError(undefined);
|
setError(undefined);
|
||||||
}}
|
}}
|
||||||
@ -351,7 +350,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
|
|||||||
x: e.pageX,
|
x: e.pageX,
|
||||||
y: e.pageY
|
y: e.pageY
|
||||||
});
|
});
|
||||||
setState("showAttributeDetail");
|
setState("showAttributeDetail");
|
||||||
} else {
|
} else {
|
||||||
setState("showHelpTooltip");
|
setState("showHelpTooltip");
|
||||||
}
|
}
|
||||||
@ -373,7 +372,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
|
|||||||
onClick={save}
|
onClick={save}
|
||||||
/> }
|
/> }
|
||||||
|
|
||||||
<ActionButton
|
<ActionButton
|
||||||
icon="bx bx-plus"
|
icon="bx bx-plus"
|
||||||
className="add-new-attribute-button tn-tool-button"
|
className="add-new-attribute-button tn-tool-button"
|
||||||
text={escapeQuotes(t("attribute_editor.add_a_new_attribute"))}
|
text={escapeQuotes(t("attribute_editor.add_a_new_attribute"))}
|
||||||
@ -407,7 +406,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
|
|||||||
|
|
||||||
{attributeDetailWidgetEl}
|
{attributeDetailWidgetEl}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPreprocessedData(currentValue: string) {
|
function getPreprocessedData(currentValue: string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user