fix: fix error message on media upload (#1959)

This commit is contained in:
Nolan Lawson 2021-02-15 19:23:01 -08:00 committed by GitHub
parent c209fb23d5
commit ba3b76f769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import { uploadMedia } from '../_api/media'
import { toast } from '../_components/toast/toast'
import { scheduleIdleTask } from '../_utils/scheduleIdleTask'
import { setCachedMediaFile } from '../_utils/mediaUploadFileCache'
import { formatIntl } from '../_utils/formatIntl'
export async function doMediaUpload (realm, file) {
const { currentInstance, accessToken } = store.get()
@ -25,7 +26,7 @@ export async function doMediaUpload (realm, file) {
scheduleIdleTask(() => store.save())
} catch (e) {
console.error(e)
/* no await */ toast.say('intl.failedToUploadMedia', { error: (e.message || '') })
/* no await */ toast.say(formatIntl('intl.failedToUploadMedia', { error: (e.message || '') }))
} finally {
store.set({ uploadingMedia: false })
}