22 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
44
5+ // @flow
6+
57import React from "react" ;
68import { bindActionCreators , combineReducers } from "redux" ;
79import ReactDOM from "react-dom" ;
@@ -30,8 +32,11 @@ import { prefs } from "./prefs";
3032function renderPanel ( component , store ) {
3133 const root = document . createElement ( "div" ) ;
3234 root . className = "launchpad-root theme-body" ;
33- root . style . setProperty ( "flex" , 1 ) ;
35+ root . style . setProperty ( "flex" , "1" ) ;
3436 const mount = document . querySelector ( "#mount" ) ;
37+ if ( ! mount ) {
38+ return ;
39+ }
3540 mount . appendChild ( root ) ;
3641
3742 ReactDOM . render (
@@ -40,7 +45,7 @@ function renderPanel(component, store) {
4045 ) ;
4146}
4247
43- export function bootstrapStore ( client , { services, toolboxActions } ) {
48+ export function bootstrapStore ( client : any , { services, toolboxActions } : any ) {
4449 const createStore = configureStore ( {
4550 log : isTesting ( ) || getValue ( "logging.actions" ) ,
4651 timing : isDevelopment ( ) ,
@@ -80,7 +85,7 @@ export function teardownWorkers() {
8085 stopSearchWorker ( ) ;
8186}
8287
83- export function bootstrapApp ( store ) {
88+ export function bootstrapApp ( store : any ) {
8489 if ( isFirefoxPanel ( ) ) {
8590 renderPanel ( App , store ) ;
8691 } else {
@@ -89,7 +94,7 @@ export function bootstrapApp(store) {
8994 }
9095}
9196
92- function updatePrefs ( state ) {
97+ function updatePrefs ( state : any ) {
9398 const pendingBreakpoints = selectors . getPendingBreakpoints ( state ) ;
9499
95100 if ( prefs . pendingBreakpoints !== pendingBreakpoints ) {
0 commit comments