From 206f10486251d32a41f31419de77ce12033d5ba5 Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 19 Feb 2017 14:44:05 -0500 Subject: Allow unsetting channel --- lib/serve.js | 7 ++++--- 1 file 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: { -- cgit v1.2.3