git ssb

16+

Dominic / patchbay



Commit 8bf58f99dd17bfab291aed906bb0597c6f7f6920

improve invite experience -- auto-forward if already following and make screen friendlier

Ev Bogue committed on 12/26/2016, 12:40:11 AM
Parent: a5445e6bcd23a22f2da4671b84e81eedc42d81a6

Files changed

modules_basic/invite.jschanged
modules_basic/invite.jsView
@@ -34,9 +34,9 @@
3434 invite_accept: function (invite, onProgress, cb) {
3535 var data = self.invite_parse(invite)
3636 if(!data) return cb(new Error('not a valid invite code:' + invite))
3737
38- onProgress('connecting...')
38 + onProgress('Connecting...')
3939
4040 api.sbot_gossip_connect(data.remote, function (err) {
4141 if(err) console.log(err)
4242 })
@@ -45,21 +45,21 @@
4545 remote: data.invite,
4646 manifest: { invite: {use: 'async'}, getAddress: 'async' }
4747 }, function (err, sbot) {
4848 if(err) return cb(err)
49- onProgress('requesting follow...')
49 + onProgress('Requesting follow...')
5050 console.log(sbot)
5151 sbot.invite.use({feed: id}, function (err, msg) {
5252
5353 //if they already follow us, just check we actually follow them.
5454 if(err) api.follower_of(id, data.key, function (_err, follows) {
55- if(follows) cb(err)
55 + if(follows) { location.hash = '' }
5656 else next()
5757 })
5858 else next()
5959
6060 function next () {
61- onProgress('following...')
61 + onProgress('Following...')
6262
6363 //remove the seed from the shs address.
6464 //then it's correct address.
6565 //this should make the browser connect to this as remote.
@@ -87,15 +87,17 @@
8787 //connect to server
8888 //request follow
8989 //post pub announce
9090 //post follow pub
91- var div = h('div.column',
92- h('div',
93- "you have been invited to join:", h('br'),
94- h('code', data.invite)
91 + var div = h('div.column.scroller__wrapper',
92 + h('div.column.scroller__content', {style: 'margin-top: 25%;'},
93 + h('h1', {innerHTML: 'The <a href="https://scuttlebot.io">Secure Scuttlebutt</a> Lite Client'}),
94 + h('p', "You've been invited to join:"),
95 + h('p', h('code', data.invite))
9596 ),
96- h('button', 'accept', {onclick: attempt}),
97- progress
97 + h('p', h('button', 'Accept', {onclick: attempt})),
98 + progress,
99 + h('p', "Once you're in, give yourself a name and photo. And don't forget to say 'Hello!'")
98100 )
99101
100102 function attempt () {
101103 self.invite_accept(invite, function (message) {

Built with git-ssb-web