git ssb

16+

cel / patchfoo



Commit 31301646eb23b3edcc23cb3cb8980ed451b0c108

Render chess invite/accept messages more compactly

cel committed on 8/9/2018, 10:03:07 PM
Parent: e9c8e944c7d46091a5b7e1480deb8951137f629c

Files changed

lib/render-msg.jschanged
lib/render-msg.jsView
@@ -1321,9 +1321,9 @@
13211321 var self = this
13221322 var myColor = self.c.myColor
13231323 self.link(self.c.inviting, function (err, link) {
13241324 if (err) return cb(err)
1325- self.wrap([
1325 + self.wrapMini([
13261326 'invites ', link, ' to play chess',
13271327 // myColor ? h('p', 'my color is ' + myColor) : ''
13281328 ], cb)
13291329 })
@@ -1343,14 +1343,18 @@
13431343 }
13441344
13451345 RenderMsg.prototype.chessInviteAccept = function (cb) {
13461346 var self = this
1347- self.link(self.c.root, function (err, rootLink) {
1347 + self.getMsg(self.c.root, function (err, rootMsg) {
13481348 if (err) return cb(err)
1349- self.wrap([
1350- h('div', h('small', '> ', rootLink)),
1351- h('p', 'accepts invitation to play chess')
1352- ], cb)
1349 + self.link(rootMsg.value.author, function (err, rootAuthorLink) {
1350 + if (err) return cb(err)
1351 + self.wrapMini([
1352 + 'accepts ',
1353 + h('a', {href: self.toUrl(rootMsg.key)}, 'invitation to play chess'), ' ',
1354 + 'with ', rootAuthorLink
1355 + ], cb)
1356 + })
13531357 })
13541358 }
13551359
13561360 RenderMsg.prototype.chessGameEnd = function (cb) {

Built with git-ssb-web