aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/inpage.js
diff options
context:
space:
mode:
authorbitpshr <mail@bitpshr.net>2018-04-19 05:02:08 +0800
committerbitpshr <mail@bitpshr.net>2018-04-19 05:02:08 +0800
commitc9f83fe8bc60a87876242a2dfb5350fceafffca1 (patch)
tree2def53846824b39fde470931cf36ee67a8e4a03b /app/scripts/inpage.js
parent7e21fc2aa780ccb4ffb2f642156385db22c47a52 (diff)
downloadtangerine-wallet-browser-c9f83fe8bc60a87876242a2dfb5350fceafffca1.tar.gz
tangerine-wallet-browser-c9f83fe8bc60a87876242a2dfb5350fceafffca1.tar.zst
tangerine-wallet-browser-c9f83fe8bc60a87876242a2dfb5350fceafffca1.zip
Add JSDoc to various background scripts
Diffstat (limited to 'app/scripts/inpage.js')
-rw-r--r--app/scripts/inpage.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index 92c732813..798af78bf 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -42,20 +42,18 @@ log.debug('MetaMask - injected web3')
setupDappAutoReload(web3, inpageProvider.publicConfigStore)
// set web3 defaultAccount
-
inpageProvider.publicConfigStore.subscribe(function (state) {
web3.eth.defaultAccount = state.selectedAddress
})
-//
-// util
-//
-
// need to make sure we aren't affected by overlapping namespaces
// and that we dont affect the app with our namespace
// mostly a fix for web3's BigNumber if AMD's "define" is defined...
var __define
+/**
+ * Caches reference to global define object and deletes it
+ */
function cleanContextForImports () {
__define = global.define
try {
@@ -65,6 +63,9 @@ function cleanContextForImports () {
}
}
+/**
+ * Restores global define object from cached reference
+ */
function restoreContextAfterImports () {
try {
global.define = __define