Skip to content

Commit

Permalink
Add OpenChat ProposalsBot to list of named neurons (#4542)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Oct 10, 2023
1 parent 0f28a3d commit de8620a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,18 @@
}
}
function truncatedProposerId(): string {
const name = NamedNeurons[proposal.proposer];
function renderNeuronId(neuronId: string): string {
const name = NamedNeurons[neuronId];
if (name !== undefined) {
return name;
}
if (proposal.proposer.length < 12) {
return proposal.proposer;
const length = neuronId.length;
if (length < 12) {
return neuronId;
}
return `${proposal.proposer.slice(0, 4)}..${proposal.proposer.slice(
proposal.proposer.length - 4,
proposal.proposer.length
)}`;
return `${neuronId.slice(0, 4)}..${neuronId.slice(length - 4, length)}`;
}
export function getProposalTopicLabel(
Expand Down Expand Up @@ -249,7 +247,7 @@
<div class="subtitle">
{typeValue} |
{$_("proposal.proposedBy")}
<a target="_blank" rel="noreferrer" href={proposerUrl}>{truncatedProposerId()}</a>
<a target="_blank" rel="noreferrer" href={proposerUrl}>{renderNeuronId(proposal.proposer)}</a>
</div>
</div>
{/if}
Expand Down
1 change: 1 addition & 0 deletions frontend/app/src/stores/namedNeurons.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// prettier-ignore
export const NamedNeurons: Record<string, string> = {
"afdbb46396374af0baad270f06e738fbf60997359e3f1bbea2293312e3278aef": "OpenChat Dev Team",
"2e6deec3460a3b74d4b9077462cacc36c9f3403577c8fbf4a9babe25799b7f8b": "OpenChat ProposalsBot",
"54f9ba2b0e81a17f5261b277abd91816e041c5ca749ba88b3dbe05f66bb6124d": "HotOrNot Dev Team",
"f513314523830ed270c65c4fa2bd6473b2bba3e4faf91b0e0782bf21c2e4ab25": "Dragginz Dev Team",
"9641cdd7c4f487c1ed146b7abb3ee9d38a4e77cadc681bf1cc091439011e3f87": "Kinic Developer Organization",
Expand Down

0 comments on commit de8620a

Please sign in to comment.