notification-manager - rename show -> showPoup + make getPopup private

feature/default_network_editable
kumavis 8 years ago
parent aa06183c64
commit 86e882c51a
  1. 2
      app/scripts/background.js
  2. 20
      app/scripts/lib/notification-manager.js

@ -147,7 +147,7 @@ function setupController (initState) {
// popup trigger
function triggerUi () {
if (!popupIsOpen) notificationManager.show()
if (!popupIsOpen) notificationManager.showPopup()
}
// On first install, open a window to MetaMask website to how-it-works.

@ -9,8 +9,8 @@ class NotificationManager {
// Public
//
show () {
this.getPopup((err, popup) => {
showPopup () {
this._getPopup((err, popup) => {
if (err) throw err
if (popup) {
@ -31,15 +31,8 @@ class NotificationManager {
})
}
getPopup (cb) {
this._getWindows((err, windows) => {
if (err) throw err
cb(null, this._getPopupIn(windows))
})
}
closePopup () {
this.getPopup((err, popup) => {
this._getPopup((err, popup) => {
if (err) throw err
if (!popup) return
extension.windows.remove(popup.id, console.error)
@ -50,6 +43,13 @@ class NotificationManager {
// Private
//
_getPopup (cb) {
this._getWindows((err, windows) => {
if (err) throw err
cb(null, this._getPopupIn(windows))
})
}
_getWindows (cb) {
// Ignore in test environment
if (!extension.windows) {

Loading…
Cancel
Save