diff --git a/src/mol-geo/representation/structure/index.ts b/src/mol-geo/representation/structure/index.ts index 4716fc2c4c123884a5d4e6c5104ea5845f81a30f..968950ec94c4fcb8a64d80b7926fdb2022c3ba31 100644 --- a/src/mol-geo/representation/structure/index.ts +++ b/src/mol-geo/representation/structure/index.ts @@ -11,7 +11,7 @@ import { RenderObject } from 'mol-gl/render-object'; import { Representation, RepresentationProps } from '..'; import { ColorTheme } from '../../theme'; import { PickingId } from '../../util/picking'; -import { Loci, EmptyLoci } from 'mol-model/loci'; +import { Loci, EmptyLoci, isEmptyLoci } from 'mol-model/loci'; import { MarkerAction } from '../../util/marker-data'; export interface UnitsRepresentation<P> { @@ -47,7 +47,7 @@ export function StructureRepresentation<P extends StructureProps>(reprCtor: () = function getLoci(pickingId: PickingId) { for (let i = 0, il = groupReprs.length; i < il; ++i) { const loc = groupReprs[i].repr.getLoci(pickingId) - if (loc) return loc + if (!isEmptyLoci(loc)) return loc } return EmptyLoci } diff --git a/src/mol-view/label.ts b/src/mol-view/label.ts index ddb518bd654858148307eaa74e8e92da40ff43c4..da98fa3b7aa660d3ddbec8fc193b7068fd3a234e 100644 --- a/src/mol-view/label.ts +++ b/src/mol-view/label.ts @@ -23,7 +23,7 @@ export function labelFirst(loci: Loci): string { if (e && e.indices[0] !== undefined) { return elementLabel(Element.Location(e.unit, e.indices[0])) } else { - return 'Nothing' + return 'Unknown' } case 'link-loci': const bond = loci.links[0] @@ -32,10 +32,10 @@ export function labelFirst(loci: Loci): string { setElementLocation(elementLocB, bond.bUnit, bond.bIndex) return `${elementLabel(elementLocA)} - ${elementLabel(elementLocB)}` } else { - return 'Nothing' + return 'Unknown' } case 'every-loci': - return 'Evertything' + return 'Everything' case 'empty-loci': return 'Nothing' }