aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-02-19 14:44:05 -0500
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-02-19 14:44:05 -0500
commit206f10486251d32a41f31419de77ce12033d5ba5 (patch)
treed18aee0f6b08e1899a2462ad679d77bcb25c0946
parentb6e8e9f344a9029560e4b762f4f0fa737f78a514 (diff)
downloadpatchfoo-206f10486251d32a41f31419de77ce12033d5ba5.tar.gz
patchfoo-206f10486251d32a41f31419de77ce12033d5ba5.zip
Allow unsetting channel
-rw-r--r--lib/serve.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/serve.js b/lib/serve.js
index f8d9cf1..d739659 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -819,6 +819,7 @@ Serve.prototype.composer = function (opts, cb) {
if (data.blob_type && blobs[data.blob_link]) {
blobs[data.blob_link].type = data.blob_type
}
+ var channel = data.channel != null ? data.channel : opts.channel
var done = multicb({pluck: 1, spread: true})
done()(null, h('section.composer',
@@ -829,9 +830,9 @@ Serve.prototype.composer = function (opts, cb) {
opts.recps ? self.app.render.privateLine(opts.recps, done()) :
opts.private ? h('div', h('input.recps-input', {name: 'recps',
value: data.recps || '', placeholder: 'recipient ids'})) : '',
- data.channel || opts.channel != null ?
+ channel != null ?
h('div', '#', h('input', {name: 'channel', placeholder: 'channel',
- value: data.channel || opts.channel || ''})) : '',
+ value: channel})) : '',
h('textarea', {
id: opts.id,
name: 'text',
@@ -899,7 +900,7 @@ Serve.prototype.composer = function (opts, cb) {
}
if (opts.root) content.root = opts.root
if (opts.branches) content.branch = u.fromArray(opts.branches)
- if (data.channel) content.channel = data.channel
+ if (channel) content.channel = data.channel
}
var msg = {
value: {