diff options
author | Mark Stacey <markjstacey@gmail.com> | 2019-07-06 01:01:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-06 01:01:34 +0800 |
commit | 95f198550e419c598750a1717014dac6ca5091e9 (patch) | |
tree | 50720fa452bf11b9f0ec720f84f70bd2231d38d2 /ui/app/pages | |
parent | 0311f2d28c60fb82141dee471c19ad085930f8cc (diff) | |
download | tangerine-wallet-browser-95f198550e419c598750a1717014dac6ca5091e9.tar tangerine-wallet-browser-95f198550e419c598750a1717014dac6ca5091e9.tar.gz tangerine-wallet-browser-95f198550e419c598750a1717014dac6ca5091e9.tar.bz2 tangerine-wallet-browser-95f198550e419c598750a1717014dac6ca5091e9.tar.lz tangerine-wallet-browser-95f198550e419c598750a1717014dac6ca5091e9.tar.xz tangerine-wallet-browser-95f198550e419c598750a1717014dac6ca5091e9.tar.zst tangerine-wallet-browser-95f198550e419c598750a1717014dac6ca5091e9.zip |
Declare variables before use (#6806)
While working on #6805, I noticed that many variables were being used
before they were declared. Technically this worked fine in practice
because we were using the `transform-es2015-block-scoping` Babel plugin,
which transforms `let` and `const` to `var`, which is hoisted. However,
after removing that Babel transformation, many things broke.
All instances of variables or classes being used before declared have
been fixed.
The `no-use-before-define` eslint rule has been added to catch these
cases going forward. The rule is disabled for function declarations for
the moment, because those are always hoisted. We could disable that too
if we want to, but it's purely stylistic and would require a lot more
changes.
Diffstat (limited to 'ui/app/pages')
-rw-r--r-- | ui/app/pages/routes/index.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ui/app/pages/routes/index.js b/ui/app/pages/routes/index.js index afef0692e..c292fd9c7 100644 --- a/ui/app/pages/routes/index.js +++ b/ui/app/pages/routes/index.js @@ -183,18 +183,6 @@ class Routes extends Component { this.getConnectingLabel(loadingMessage) : null log.debug('Main ui render function') - const sidebarOnOverlayClose = sidebarType === WALLET_VIEW_SIDEBAR - ? () => { - this.context.metricsEvent({ - eventOpts: { - category: 'Navigation', - action: 'Wallet Sidebar', - name: 'Closed Sidebare Via Overlay', - }, - }) - } - : null - const { isOpen: sidebarIsOpen, transitionName: sidebarTransitionName, @@ -203,6 +191,18 @@ class Routes extends Component { } = sidebar const { transaction: sidebarTransaction } = props || {} + const sidebarOnOverlayClose = sidebarType === WALLET_VIEW_SIDEBAR + ? () => { + this.context.metricsEvent({ + eventOpts: { + category: 'Navigation', + action: 'Wallet Sidebar', + name: 'Closed Sidebare Via Overlay', + }, + }) + } + : null + return ( <div className="app" |