Skip to content

Commit aeebd75

Browse files
committed
Fixed truncate last char on the address, made the address identifier lower case
1 parent 256e566 commit aeebd75

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

js/labels.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Labels {
4242
}
4343

4444
async add(name, address, color) {
45+
address = address.toLowerCase();
4546
await this.addLabelledAddress(address);
4647

4748
return await this.set({
@@ -79,7 +80,7 @@ class Labels {
7980

8081
shortenAddress(address) {
8182
const beginning = address.slice(0, BEGINNING_AND_END_CHARS_IN_ADDR_TO_SHOW);
82-
const end = address.slice(address.length - BEGINNING_AND_END_CHARS_IN_ADDR_TO_SHOW, address.length - 1);
83+
const end = address.slice(address.length - BEGINNING_AND_END_CHARS_IN_ADDR_TO_SHOW, address.length);
8384

8485
return `${beginning}...${end}`;
8586
}
@@ -170,10 +171,10 @@ class Labels {
170171
}
171172

172173
async getLabelForAddress(address) {
173-
const retrievedObject = await this.get(address);
174+
const retrievedObject = await this.get(address.toLowerCase());
174175

175176
if (retrievedObject) {
176-
return retrievedObject[address];
177+
return retrievedObject[address.toLowerCase()];
177178
}
178179
}
179180

0 commit comments

Comments
 (0)