git ssb

0+

ev / microbay



forked from Dominic / patchbay

Commit e273010065ffea194bcb8199f124bd13fa441c47

Re-enable publish button if user cancels publish

Charles Lehner committed on 8/2/2016, 12:39:43 AM
Parent: 4297a42a6a9727bda3d92f59855d0b7efa361c28

Files changed

modules/compose.jschanged
modules/message-confirm.jschanged
modules/compose.jsView
@@ -67,9 +67,10 @@
6767 message_confirm(content, done)
6868
6969 function done (err, msg) {
7070 publishBtn.disabled = false
71- if(err) return alert(err.stack)
71+ if(err === 'cancelled') return
72+ else if(err) return alert(err.stack)
7273 else ta.value = ''
7374
7475 if (cb) cb(err, msg)
7576 }
modules/message-confirm.jsView
@@ -21,8 +21,9 @@
2121 }})
2222
2323 var cancel = h('button', 'cancel', {onclick: function () {
2424 lb.remove()
25+ cb('cancelled')
2526 }})
2627
2728 okay.addEventListener('keydown', function (ev) {
2829 if(ev.keyCode === 27) cancel.click() //escape

Built with git-ssb-web