about summary refs log tree commit diff
path: root/app/javascript/mastodon/actions/onboarding.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/mastodon/actions/onboarding.js')
-rw-r--r--app/javascript/mastodon/actions/onboarding.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/javascript/mastodon/actions/onboarding.js b/app/javascript/mastodon/actions/onboarding.js
new file mode 100644
index 000000000..a161c50ef
--- /dev/null
+++ b/app/javascript/mastodon/actions/onboarding.js
@@ -0,0 +1,14 @@
+import { openModal } from './modal';
+import { changeSetting, saveSettings } from './settings';
+
+export function showOnboardingOnce() {
+  return (dispatch, getState) => {
+    const alreadySeen = getState().getIn(['settings', 'onboarded']);
+
+    if (!alreadySeen) {
+      dispatch(openModal('ONBOARDING'));
+      dispatch(changeSetting(['onboarded'], true));
+      dispatch(saveSettings());
+    }
+  };
+};