git ssb

2+

mixmix / ticktack



Commit d6b91ba09ab42e5e8e2f376d3ddbc9cf8a9c0d76

minimal onboarding prompt

mix irving committed on 8/27/2017, 11:43:15 PM
Parent: de37b65fbf601aba3ebadaa0e9d9aeeb3576322c

Files changed

app/html/app.jschanged
app/page/settings.jschanged
app/html/app.jsView
@@ -14,14 +14,17 @@
1414 'history.sync.back': true,
1515 })
1616
1717 exports.needs = nest({
18+ 'about.async.suggest': 'first',
1819 'app.html.header': 'first',
1920 'app.async.catchLinkClick': 'first',
21+ 'channel.async.suggest': 'first',
22+ 'keys.sync.id': 'first',
2023 'router.sync.router': 'first',
24+ 'settings.sync.get': 'first',
25+ 'settings.sync.set': 'first',
2126 'styles.css': 'reduce',
22- 'about.async.suggest': 'first',
23- 'channel.async.suggest': 'first',
2427 })
2528
2629 exports.create = (api) => {
2730 var nav = null
@@ -45,9 +48,26 @@
4548 api.router.sync.router,
4649 api.app.html.header
4750 )
4851
49- nav.push({page: 'home'})
52+ const isOnboarded = api.settings.sync.get('onboarded')
53+ if (isOnboarded)
54+ nav.push({page: 'home'})
55+ else {
56+ nav.push({
57+ page:'userEdit',
58+ feed: api.keys.sync.id(),
59+ callback: (err, didEdit) => {
60+ if (err) throw new Error ('Error editing profile', err)
61+
62+ if (didEdit)
63+ api.settings.sync.set({ onboarded: true })
64+
65+ nav.push({ page: 'home' })
66+ }
67+ })
68+ }
69+
5070 return nav
5171 },
5272 'history.sync.push': (location) => nav.push(location),
5373 'history.sync.back': () => nav.back(),
app/page/settings.jsView
@@ -14,12 +14,15 @@
1414 'translations.sync.strings': 'first',
1515 })
1616
1717 const LANGUAGES = ['zh', 'en']
18-const DEFAULT_SETTINGS = {
19- language: 'zh'
20-}
2118
19+// TODO - this needs moving somewhere upstream
20+// const DEFAULT_SETTINGS = {
21+// onboarded: false,
22+// language: 'zh'
23+// }
24+
2225 exports.create = (api) => {
2326 return nest('app.page.settings', settings)
2427
2528 function settings (location) {

Built with git-ssb-web