aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-01-09 20:44:01 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-01-09 20:44:01 -1000
commit2cea6dd8bfa1230c2c7aa48fab6a48af6c148a30 (patch)
tree8dcbfcdc6d1039c4a4803353f5678be96890d30b
parent52170b13bd7c8d5b248761354e13846f204df04a (diff)
downloadpatchfoo-2cea6dd8bfa1230c2c7aa48fab6a48af6c148a30.tar.gz
patchfoo-2cea6dd8bfa1230c2c7aa48fab6a48af6c148a30.zip
Handle multiple line comment thread composers
-rw-r--r--lib/serve.js39
1 files changed, 21 insertions, 18 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 4923667..7df2da9 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -2701,26 +2701,23 @@ Serve.prototype.wrapBinary = function (opts) {
}, String(lineNum))),
ph('td', ph('pre', self.app.render.highlight(line, ext)))
]),
- (lineComments[lineNum] ?
- ph('tr',
- ph('td', {colspan: 4},
- self.renderLineCommentThread(lineComments[lineNum], id)
- )
+ lineComments[lineNum] ? ph('tr',
+ ph('td', {colspan: 4},
+ self.renderLineCommentThread(lineComments[lineNum], id)
)
- : self.query.comment === id ?
- ph('tr',
- ph('td', {colspan: 4},
- self.renderLineCommentForm({
- id: id,
- line: lineNum,
- updateId: updateMsg.key,
- repoId: updateMsg.value.content.repo,
- commitId: commitId,
- filePath: filePath,
- })
- )
+ ) : '',
+ self.query.comment === id ? ph('tr',
+ ph('td', {colspan: 4},
+ self.renderLineCommentForm({
+ id: id,
+ line: lineNum,
+ updateId: updateMsg.key,
+ repoId: updateMsg.value.content.repo,
+ commitId: commitId,
+ filePath: filePath,
+ })
)
- : '')
+ ) : ''
]
})
)
@@ -2941,6 +2938,11 @@ Serve.prototype.composer = function (opts, cb) {
var data = self.data
var myId = self.app.sbot.id
+ if (opts.id && data.composer_id && opts.id !== data.composer_id) {
+ // don't share data between multiple composers
+ data = {}
+ }
+
if (!data.text && self.query.text) data.text = self.query.text
if (!data.action && self.query.action) data.action = self.query.action
@@ -3034,6 +3036,7 @@ Serve.prototype.composer = function (opts, cb) {
enctype: 'multipart/form-data'},
h('input', {type: 'hidden', name: 'blobs',
value: JSON.stringify(blobs)}),
+ h('input', {type: 'hidden', name: 'composer_id', value: opts.id}),
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'})) : '',