git ssb

0+

ev / microbay



forked from Dominic / patchbay

Commit bcf36097d3029f82d022b7ae091151857df0c16f

indicate publish cancel with null message

%H2dGX6TRHwgt4ZW2qhc30PN/7MCVq+rGV1l2n8favys=.sha256
Charles Lehner committed on 8/2/2016, 7:20:32 AM
Parent: e273010065ffea194bcb8199f124bd13fa441c47

Files changed

modules/compose.jschanged
modules/message-confirm.jschanged
modules/compose.jsView
@@ -59,19 +59,19 @@
5959 try {
6060 meta = prepublish(meta)
6161 } catch (err) {
6262 publishBtn.disabled = false
63- return alert(err.message)
63+ if (cb) cb(err)
64+ else alert(err.message)
6465 }
6566 return message_confirm(meta, done)
6667 }
6768 message_confirm(content, done)
6869
6970 function done (err, msg) {
7071 publishBtn.disabled = false
71- if(err === 'cancelled') return
72- else if(err) return alert(err.stack)
73- else ta.value = ''
72+ if(err) return alert(err.stack)
73+ else if (msg) ta.value = ''
7474
7575 if (cb) cb(err, msg)
7676 }
7777 }
modules/message-confirm.jsView
@@ -21,9 +21,9 @@
2121 }})
2222
2323 var cancel = h('button', 'cancel', {onclick: function () {
2424 lb.remove()
25- cb('cancelled')
25+ cb(null)
2626 }})
2727
2828 okay.addEventListener('keydown', function (ev) {
2929 if(ev.keyCode === 27) cancel.click() //escape

Built with git-ssb-web