diff --git a/browser/app/js/browser/StorageInfo.js b/browser/app/js/browser/StorageInfo.js
index 162298b21..67f51e238 100644
--- a/browser/app/js/browser/StorageInfo.js
+++ b/browser/app/js/browser/StorageInfo.js
@@ -26,7 +26,13 @@ export class StorageInfo extends React.Component {
}
render() {
const { used } = this.props.storageInfo
- var totalUsed = used.reduce((v1, v2) => v1 + v2, 0)
+
+ if (!used) {
+ return
+ }
+
+ const totalUsed = used.reduce((v1, v2) => v1 + v2, 0)
+
return (
diff --git a/browser/app/js/browser/__tests__/StorageInfo.test.js b/browser/app/js/browser/__tests__/StorageInfo.test.js
index 619d0d45b..24af9af8b 100644
--- a/browser/app/js/browser/__tests__/StorageInfo.test.js
+++ b/browser/app/js/browser/__tests__/StorageInfo.test.js
@@ -35,4 +35,15 @@ describe("StorageInfo", () => {
)
expect(fetchStorageInfo).toHaveBeenCalled()
})
+
+ it("should not render anything if used is null", () => {
+ const fetchStorageInfo = jest.fn()
+ const wrapper = shallow(
+
+ )
+ expect(wrapper.text()).toBe("")
+ })
})
diff --git a/browser/ui-assets.go b/browser/ui-assets.go
index 20a7a7fe7..ecdc35fee 100644
--- a/browser/ui-assets.go
+++ b/browser/ui-assets.go
@@ -1,4 +1,4 @@
-// Package browser Code generated by go-bindata. (@generated) DO NOT EDIT.
+// Code generated by go-bindata.
// sources:
// production/chrome.png
// production/favicon-16x16.png
@@ -6,14 +6,17 @@
// production/favicon-96x96.png
// production/firefox.png
// production/index.html
-// production/index_bundle-2019-10-23T04-04-41Z.js
+// production/index_bundle-2019-10-28T16-27-23Z.js
// production/loader.css
// production/logo.svg
// production/safari.png
+// DO NOT EDIT!
+
package browser
import (
"fmt"
+ "github.com/elazarl/go-bindata-assetfs"
"io/ioutil"
"os"
"path/filepath"
@@ -33,32 +36,21 @@ type bindataFileInfo struct {
modTime time.Time
}
-// Name return file name
func (fi bindataFileInfo) Name() string {
return fi.name
}
-
-// Size return file size
func (fi bindataFileInfo) Size() int64 {
return fi.size
}
-
-// Mode return file mode
func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode
}
-
-// Mode return file modify time
func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime
}
-
-// IsDir return file whether a directory
func (fi bindataFileInfo) IsDir() bool {
- return fi.mode&os.ModeDir != 0
+ return false
}
-
-// Sys return file is sys mode
func (fi bindataFileInfo) Sys() interface{} {
return nil
}
@@ -75,7 +67,7 @@ func productionChromePng() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/chrome.png", size: 3726, mode: os.FileMode(420), modTime: time.Unix(1571803505, 0)}
+ info := bindataFileInfo{name: "production/chrome.png", size: 3726, mode: os.FileMode(420), modTime: time.Unix(1572280054, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -92,7 +84,7 @@ func productionFavicon16x16Png() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/favicon-16x16.png", size: 14906, mode: os.FileMode(420), modTime: time.Unix(1571803505, 0)}
+ info := bindataFileInfo{name: "production/favicon-16x16.png", size: 14906, mode: os.FileMode(420), modTime: time.Unix(1572280054, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -109,7 +101,7 @@ func productionFavicon32x32Png() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/favicon-32x32.png", size: 16066, mode: os.FileMode(420), modTime: time.Unix(1571803505, 0)}
+ info := bindataFileInfo{name: "production/favicon-32x32.png", size: 16066, mode: os.FileMode(420), modTime: time.Unix(1572280054, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -126,7 +118,7 @@ func productionFavicon96x96Png() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/favicon-96x96.png", size: 17029, mode: os.FileMode(420), modTime: time.Unix(1571803505, 0)}
+ info := bindataFileInfo{name: "production/favicon-96x96.png", size: 17029, mode: os.FileMode(420), modTime: time.Unix(1572280054, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -143,7 +135,7 @@ func productionFirefoxPng() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "production/firefox.png", size: 4795, mode: os.FileMode(420), modTime: time.Unix(1571803505, 0)}
+ info := bindataFileInfo{name: "production/firefox.png", size: 4795, mode: os.FileMode(420), modTime: time.Unix(1572280054, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -203,8 +195,8 @@ var _productionIndexHTML = []byte(`
-
-
+
+