aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-30 15:12:30 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-05-30 15:12:30 -1000
commit6f04462393dc718d7d49780bd88c5fbd0aa98d72 (patch)
tree5b3c1a380ad7feb27f0e0b478835ab0044d83614
parentd38a331636e3fd38ef60c926272452f0f3d7f7cf (diff)
downloadpatchfoo-6f04462393dc718d7d49780bd88c5fbd0aa98d72.tar.gz
patchfoo-6f04462393dc718d7d49780bd88c5fbd0aa98d72.zip
Fix handling multiple uploads
-rw-r--r--lib/serve.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/serve.js b/lib/serve.js
index e0d9396..9d6f0b8 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -1945,9 +1945,8 @@ Serve.prototype.composer = function (opts, cb) {
var formEmojiNames = {}
var emojiIds = u.toArray(data.emoji_id)
var emojiNames = u.toArray(data.emoji_name)
- var emojiUploads = u.toArray(data.emoji_upload)
for (var i = 0; i < emojiIds.length && i < emojiNames.length; i++) {
- var upload = emojiUploads[i]
+ var upload = data['emoji_upload_' + i]
formEmojiNames[emojiNames[i]] =
(upload && upload.link) || u.extractBlobIds(emojiIds[i])[0]
if (upload) blobs[upload.link] = {
@@ -2043,14 +2042,14 @@ Serve.prototype.composer = function (opts, cb) {
] : '',
emoji.length > 0 ? [
h('div', h('em', 'emoji:')),
- h('ul.mentions', emoji.map(function (link) {
+ h('ul.mentions', emoji.map(function (link, i) {
return h('li',
h('code', link.name), ': ',
h('input', {name: 'emoji_name', type: 'hidden',
value: link.name}),
h('input.id-input', {name: 'emoji_id', size: 60,
value: link.id, placeholder: '&id'}), ' ',
- h('input', {type: 'file', name: 'emoji_upload'}))
+ h('input', {type: 'file', name: 'emoji_upload_' + i}))
}))
] : '',
h('table.ssb-msgs',