about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/ui/components/bundle.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-03-15 05:35:45 +0100
committerGitHub <noreply@github.com>2019-03-15 05:35:45 +0100
commitc20d096e6a251e1b84ac47b751d2eb065743dbc2 (patch)
treef3e9fa961ba9170e1a70b3854bbe0711ec560b2f /app/javascript/mastodon/features/ui/components/bundle.js
parentff565524aa6aa35c07557ea02d8d04bb3a9e1a97 (diff)
Show disappointed elephant if web UI crashes (#10275)
* Do not crash the whole UI when loading an invalid column

* Add error boundary component to catch Web UI crashes

* Add stack trace on supported browsers

* Add component stack info, pre-format everything for github

* Make “Reload” a clickable link that calls window.location.reload()

* Remove elephant friend from error boundary, make title stand out more

* Simplify error boundary to only a graphic
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/bundle.js')
-rw-r--r--app/javascript/mastodon/features/ui/components/bundle.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/ui/components/bundle.js b/app/javascript/mastodon/features/ui/components/bundle.js
index e7d935251..a60ace35b 100644
--- a/app/javascript/mastodon/features/ui/components/bundle.js
+++ b/app/javascript/mastodon/features/ui/components/bundle.js
@@ -53,6 +53,11 @@ class Bundle extends React.PureComponent {
     const { fetchComponent, onFetch, onFetchSuccess, onFetchFail, renderDelay } = props || this.props;
     const cachedMod = Bundle.cache.get(fetchComponent);
 
+    if (fetchComponent === undefined) {
+      this.setState({ mod: null });
+      return Promise.resolve();
+    }
+
     onFetch();
 
     if (cachedMod) {