fix(backend-git-gateway): fix image display w/o large media (#2271)

This commit is contained in:
Benaiah Mischenko 2019-04-05 15:25:54 -07:00 committed by Shawn Erquhart
parent 9b1dfe1605
commit 6c3506b4d0

View File

@ -212,7 +212,10 @@ export default class GitGateway {
return Promise.all([this.backend.getMedia(), this.getLargeMediaClient()]).then(
async ([mediaFiles, largeMediaClient]) => {
if (!largeMediaClient.enabled) {
return mediaFiles;
return mediaFiles.map(({ displayURL, ...rest }) => ({
...rest,
displayURL: { original: displayURL },
}));
}
const largeMediaDisplayURLs = await this.getLargeMediaDisplayURLs(mediaFiles);
return mediaFiles.map(({ id, displayURL, path, ...rest }) => {