chore(tests): fix minor bug in restore mastodon data script (#638)

This commit is contained in:
Nolan Lawson 2018-11-12 08:42:08 -08:00 committed by GitHub
parent 8ff174b42d
commit 1fa37df59a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -55,14 +55,12 @@ export async function restoreMastodonData () {
if (action.post) { if (action.post) {
let { text, media, sensitive, spoiler, privacy, inReplyTo, internalId } = 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 mediaIds = media && await Promise.all(media.map(async mediaItem => {
let mediaResponse = await submitMedia(accessToken, mediaItem, 'kitten') let mediaResponse = await submitMedia(accessToken, mediaItem, 'kitten')
return mediaResponse.id 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') sensitive, spoiler, privacy || 'public')
if (typeof internalId !== 'undefined') { if (typeof internalId !== 'undefined') {
internalIdsToIds[internalId] = status.id internalIdsToIds[internalId] = status.id