mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Rename functions for consistency.
This commit is contained in:
parent
9f6c040554
commit
b296640f1b
@ -14,8 +14,8 @@ class AddressBookController {
|
||||
// PUBLIC METHODS
|
||||
//
|
||||
|
||||
setAddressList (address, name) {
|
||||
return this.addToAddressList(address, name)
|
||||
setAddressBook (address, name) {
|
||||
return this.addToAddressBook(address, name)
|
||||
.then((addressBook) => {
|
||||
this.store.updateState({
|
||||
addressBook,
|
||||
@ -24,9 +24,9 @@ class AddressBookController {
|
||||
})
|
||||
}
|
||||
|
||||
addToAddressList (address, name) {
|
||||
let addressBook = this.getAddressList()
|
||||
let index = addressBook.findIndex((element) => { return element.address === address })
|
||||
addToAddressBook (address, name) {
|
||||
let addressBook = this.getAddressBook()
|
||||
let index = addressBook.findIndex((element) => { return element.address === address || element.name === name })
|
||||
if (index !== -1) {
|
||||
addressBook.splice(index, 1)
|
||||
}
|
||||
@ -37,7 +37,7 @@ class AddressBookController {
|
||||
return Promise.resolve(addressBook)
|
||||
}
|
||||
|
||||
getAddressList () {
|
||||
getAddressBook () {
|
||||
return this.store.getState().addressBook
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user