diff --git a/js/modules/loki_message_api.js b/js/modules/loki_message_api.js index 3035fc7a9..c3ccf6ae8 100644 --- a/js/modules/loki_message_api.js +++ b/js/modules/loki_message_api.js @@ -209,12 +209,14 @@ class LokiMessageAPI { // Make sure we aren't doing too much PoW const currentDifficulty = window.storage.get('PoWDifficulty', null); - if (result && result.difficulty) { - const newDifficulty = result.difficulty; - if (newDifficulty != null && newDifficulty !== currentDifficulty) { - window.storage.put('PoWDifficulty', newDifficulty); - } - } // else should we return false? + if ( + result && + result.difficulty && + result.difficulty !== currentDifficulty + ) { + window.storage.put('PoWDifficulty', result.difficulty); + // should we return false? + } return true; } catch (e) { log.warn(