Skip to content

Commit

Permalink
failovers for undefined shortnames
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-salazar committed May 6, 2022
1 parent d680a32 commit fedb661
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/ProtVista/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,12 @@ export class ProtVista extends Component /*:: <Props, State> */ {
) : null;
if (entry.accession.startsWith('residue:'))
return entry.accession.split('residue:')[1];
let text = label.short ? entry.short_name : '';
if (label.short && label.accession) text += ' - ';
let text = label.short ? entry.short_name || '' : '';
if (text.length > 0 && label.accession) text += ' - ';
if (label.accession) text += entry.accession;
if ((label.accession || label.short) && label.name) text += ': ';
if (text.length > 0 && label.name) text += ': ';
if (label.name) text += entry.name;
if (text.length == 0) text += entry.accession;
return (
<>
{type}
Expand Down

0 comments on commit fedb661

Please sign in to comment.