mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
notification-manager - rename show -> showPoup + make getPopup private
This commit is contained in:
parent
aa06183c64
commit
86e882c51a
@ -147,7 +147,7 @@ function setupController (initState) {
|
|||||||
|
|
||||||
// popup trigger
|
// popup trigger
|
||||||
function triggerUi () {
|
function triggerUi () {
|
||||||
if (!popupIsOpen) notificationManager.show()
|
if (!popupIsOpen) notificationManager.showPopup()
|
||||||
}
|
}
|
||||||
|
|
||||||
// On first install, open a window to MetaMask website to how-it-works.
|
// On first install, open a window to MetaMask website to how-it-works.
|
||||||
|
@ -9,8 +9,8 @@ class NotificationManager {
|
|||||||
// Public
|
// Public
|
||||||
//
|
//
|
||||||
|
|
||||||
show () {
|
showPopup () {
|
||||||
this.getPopup((err, popup) => {
|
this._getPopup((err, popup) => {
|
||||||
if (err) throw err
|
if (err) throw err
|
||||||
|
|
||||||
if (popup) {
|
if (popup) {
|
||||||
@ -31,15 +31,8 @@ class NotificationManager {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
getPopup (cb) {
|
|
||||||
this._getWindows((err, windows) => {
|
|
||||||
if (err) throw err
|
|
||||||
cb(null, this._getPopupIn(windows))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
closePopup () {
|
closePopup () {
|
||||||
this.getPopup((err, popup) => {
|
this._getPopup((err, popup) => {
|
||||||
if (err) throw err
|
if (err) throw err
|
||||||
if (!popup) return
|
if (!popup) return
|
||||||
extension.windows.remove(popup.id, console.error)
|
extension.windows.remove(popup.id, console.error)
|
||||||
@ -50,6 +43,13 @@ class NotificationManager {
|
|||||||
// Private
|
// Private
|
||||||
//
|
//
|
||||||
|
|
||||||
|
_getPopup (cb) {
|
||||||
|
this._getWindows((err, windows) => {
|
||||||
|
if (err) throw err
|
||||||
|
cb(null, this._getPopupIn(windows))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
_getWindows (cb) {
|
_getWindows (cb) {
|
||||||
// Ignore in test environment
|
// Ignore in test environment
|
||||||
if (!extension.windows) {
|
if (!extension.windows) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user