fix: photo information undefined text

This commit is contained in:
David Ralph
2021-09-10 19:33:56 +01:00
parent 7e3fc8085e
commit 66a3629b51
2 changed files with 7 additions and 13 deletions

View File

@@ -1,5 +1,4 @@
// todo: rewrite this mess
import variables from 'modules/variables';
import { PureComponent } from 'react';
import PhotoInformation from './PhotoInformation';
@@ -134,15 +133,10 @@ export default class Background extends PureComponent {
let credit = data.photographer;
let photoURL, photographerURL;
const language = variables.language;
const languagecode = variables.languagecode;
if (backgroundAPI === 'unsplash') {
credit = data.photographer + ` ${language.getMessage(languagecode, 'background.unsplash')}`;
photoURL = data.photo_page;
photographerURL = data.photographer_page;
} else if (backgroundAPI === 'pexels') {
credit = data.photographer + ` ${language.getMessage(languagecode, 'background.pexels')}`;
photoURL = data.photo_page;
photographerURL = data.photographer_page;
}