Commit bcf36097d3029f82d022b7ae091151857df0c16f
indicate publish cancel with null message
%H2dGX6TRHwgt4ZW2qhc30PN/7MCVq+rGV1l2n8favys=.sha256Charles Lehner committed on 8/2/2016, 7:20:32 AM
Parent: e273010065ffea194bcb8199f124bd13fa441c47
Files changed
modules/compose.js | changed |
modules/message-confirm.js | changed |
modules/compose.js | ||
---|---|---|
@@ -59,19 +59,19 @@ | ||
59 | 59 | try { |
60 | 60 | meta = prepublish(meta) |
61 | 61 | } catch (err) { |
62 | 62 | publishBtn.disabled = false |
63 | - return alert(err.message) | |
63 | + if (cb) cb(err) | |
64 | + else alert(err.message) | |
64 | 65 | } |
65 | 66 | return message_confirm(meta, done) |
66 | 67 | } |
67 | 68 | message_confirm(content, done) |
68 | 69 | |
69 | 70 | function done (err, msg) { |
70 | 71 | 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 = '' | |
74 | 74 | |
75 | 75 | if (cb) cb(err, msg) |
76 | 76 | } |
77 | 77 | } |
Built with git-ssb-web