From d002d76d9fa4032c6b9030d4ee86acc405196073 Mon Sep 17 00:00:00 2001 From: Beaudan Date: Wed, 30 Jan 2019 14:03:10 +1100 Subject: [PATCH] Fix unneccesary logic and copy paste trash --- js/modules/loki_p2p_api.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/js/modules/loki_p2p_api.js b/js/modules/loki_p2p_api.js index c83ea2ce0..5281dd563 100644 --- a/js/modules/loki_p2p_api.js +++ b/js/modules/loki_p2p_api.js @@ -13,17 +13,11 @@ class LokiP2pAPI { } getContactP2pDetails(pubKey) { - if (this.contactP2pDetails[pubKey]) { - return this.contactP2pDetails[pubKey]; - } - return null; + return this.contactP2pDetails[pubKey] || null; } - removeContactP2pDetails(pubKey, address, port) { - this.contactP2pDetails[pubKey] = { - address, - port, - }; + removeContactP2pDetails(pubKey) { + delete this.contactP2pDetails[pubKey]; } }