From 1fa37df59af3df80ed55362e6f60163a15ba4bc3 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 12 Nov 2018 08:42:08 -0800 Subject: [PATCH] chore(tests): fix minor bug in restore mastodon data script (#638) --- bin/restore-mastodon-data.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/restore-mastodon-data.js b/bin/restore-mastodon-data.js index 0078661..b625fe2 100644 --- a/bin/restore-mastodon-data.js +++ b/bin/restore-mastodon-data.js @@ -55,14 +55,12 @@ export async function restoreMastodonData () { if (action.post) { let { text, media, sensitive, spoiler, privacy, inReplyTo, internalId } = action.post - if (typeof inReplyTo !== 'undefined') { - inReplyTo = internalIdsToIds[inReplyTo] - } let mediaIds = media && await Promise.all(media.map(async mediaItem => { let mediaResponse = await submitMedia(accessToken, mediaItem, 'kitten') return mediaResponse.id })) - let status = await postStatus('localhost:3000', accessToken, text, inReplyTo, mediaIds, + let inReplyToId = inReplyTo && internalIdsToIds[inReplyTo] + let status = await postStatus('localhost:3000', accessToken, text, inReplyToId, mediaIds, sensitive, spoiler, privacy || 'public') if (typeof internalId !== 'undefined') { internalIdsToIds[internalId] = status.id