about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/ui/index.js
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-12-17 11:07:17 +0100
committerGitHub <noreply@github.com>2018-12-17 11:07:17 +0100
commit9cb26bb56b6b61e4e8577519347ada40a7751cd6 (patch)
tree5a95798d4ef4b17df6798539c6a44ccebf9284a1 /app/javascript/mastodon/features/ui/index.js
parentbfd0ebf92593d048d16a3882ddf44f83fa28cee2 (diff)
Add new first-time tutorial (#9531)
* Prepare to load onboarding as a full page

* Update the first-time introduction

* Improve responsive design

* Replace speech bubble with logo

* Increase text size and reword first paragraph
Diffstat (limited to 'app/javascript/mastodon/features/ui/index.js')
-rw-r--r--app/javascript/mastodon/features/ui/index.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/ui/index.js b/app/javascript/mastodon/features/ui/index.js
index 662375a76..e11235a81 100644
--- a/app/javascript/mastodon/features/ui/index.js
+++ b/app/javascript/mastodon/features/ui/index.js
@@ -294,6 +294,7 @@ class UI extends React.PureComponent {
 
   componentWillMount () {
     window.addEventListener('beforeunload', this.handleBeforeUnload, false);
+
     document.addEventListener('dragenter', this.handleDragEnter, false);
     document.addEventListener('dragover', this.handleDragOver, false);
     document.addEventListener('drop', this.handleDrop, false);
@@ -304,8 +305,13 @@ class UI extends React.PureComponent {
       navigator.serviceWorker.addEventListener('message', this.handleServiceWorkerPostMessage);
     }
 
+    if (typeof window.Notification !== 'undefined' && Notification.permission === 'default') {
+      window.setTimeout(() => Notification.requestPermission(), 120 * 1000);
+    }
+
     this.props.dispatch(expandHomeTimeline());
     this.props.dispatch(expandNotifications());
+
     setTimeout(() => this.props.dispatch(fetchFilters()), 500);
   }