chore: Update "Used in x places" text (#84)

We cannot guarantee that this is always correct since there is repeaters and dynamic repeaters etc, but this can give a hint to how many times a component is used.
This commit is contained in:
Eric Tuvesson
2025-01-08 22:02:10 +01:00
committed by GitHub
parent 95db9f6528
commit 680bd58442

View File

@@ -991,7 +991,7 @@ export class ComponentsPanelView extends View {
// Find references
const nodeReference = HACK_findNodeReference(scope.comp.name);
const nodeReferencesText = `Used in ${nodeReference?.referenaces?.length || 0} places`;
const nodeReferencesText = `Used in ~${nodeReference?.referenaces?.length || 0} places`;
items = items.concat([
{
@@ -1122,7 +1122,7 @@ export class ComponentsPanelView extends View {
if (scope.canBecomeRoot) {
// Find references
const nodeReference = HACK_findNodeReference(scope.folder.component.name);
const nodeReferencesText = `Used in ${nodeReference?.referenaces?.length || 0} places`;
const nodeReferencesText = `Used in ~${nodeReference?.referenaces?.length || 0} places`;
items = items.concat([{
label: nodeReferencesText