Fix all "var used instead of let or const" problems in background.js

feature/default_network_editable
Whymarrh Whitby 6 years ago
parent 7f9d8de4ce
commit 969cf73fae
  1. 14
      app/scripts/background.js

@ -421,13 +421,13 @@ function setupController (initState, initLangCode) {
* The number reflects the current number of pending transactions or message signatures needing user approval. * The number reflects the current number of pending transactions or message signatures needing user approval.
*/ */
function updateBadge () { function updateBadge () {
var label = '' let label = ''
var unapprovedTxCount = controller.txController.getUnapprovedTxCount() const unapprovedTxCount = controller.txController.getUnapprovedTxCount()
var unapprovedMsgCount = controller.messageManager.unapprovedMsgCount const unapprovedMsgCount = controller.messageManager.unapprovedMsgCount
var unapprovedPersonalMsgs = controller.personalMessageManager.unapprovedPersonalMsgCount const unapprovedPersonalMsgs = controller.personalMessageManager.unapprovedPersonalMsgCount
var unapprovedTypedMsgs = controller.typedMessageManager.unapprovedTypedMessagesCount const unapprovedTypedMsgs = controller.typedMessageManager.unapprovedTypedMessagesCount
const pendingProviderRequests = controller.providerApprovalController.store.getState().providerRequests.length const pendingProviderRequests = controller.providerApprovalController.store.getState().providerRequests.length
var count = unapprovedTxCount + unapprovedMsgCount + unapprovedPersonalMsgs + unapprovedTypedMsgs + pendingProviderRequests const count = unapprovedTxCount + unapprovedMsgCount + unapprovedPersonalMsgs + unapprovedTypedMsgs + pendingProviderRequests
if (count) { if (count) {
label = String(count) label = String(count)
} }
@ -463,7 +463,7 @@ function openPopup () {
triggerUi() triggerUi()
return new Promise( return new Promise(
(resolve) => { (resolve) => {
var interval = setInterval(() => { const interval = setInterval(() => {
if (!notificationIsOpen) { if (!notificationIsOpen) {
clearInterval(interval) clearInterval(interval)
resolve() resolve()

Loading…
Cancel
Save