${this.props.language.contact_support}: https://muetab.com/contact
`; - - const removeStuff = () => { // quick code to make update modal a bit better, will replace later - document.getElementById('author').innerText = ''; - const img = document.getElementsByTagName('img')[0]; - img.parentNode.removeChild(img); - } - if (localStorage.getItem('offlineMode') === 'true') { - removeStuff(); return this.setState({ title: this.props.language.offline.title, html: this.props.language.offline.description }); } - try { // Get update log from the API - const data = await (await fetch(Constants.API_URL + '/getUpdate')).json(); - if (data.statusCode === 500) { - removeStuff(); - return this.setState({ - title: this.props.language.error.title, - html: this.props.language.error.description + supportText - }); - } - - this.setState({ - title: data.title, - date: data.published, - image: data.image, - author: data.author, - html: data.content + `${this.props.language.read_blog}: ${data.url}
` - }); - } catch (e) { // If it fails, we send an error - removeStuff(); - this.setState({ + const data = await (await fetch(Constants.API_URL + '/getUpdate')).json(); + if (data.statusCode === 500 || data.title === null) { + const supportText = `${this.props.language.contact_support}: https://muetab.com/contact
`; + return this.setState({ title: this.props.language.error.title, html: this.props.language.error.description + supportText }); } + + this.setState({ + title: data.title, + date: data.published, + image: data.image || null, + author: data.author, + html: data.content + }); } componentDidMount() { @@ -64,8 +47,8 @@ export default class Update extends React.PureComponent { return{this.state.title}
-By {this.state.author} • {this.state.date}
-{this.state.date}
+ {this.state.image ?: null} + {enabled('view') ?
{this.props.language.credit}
{this.props.language.information}
diff --git a/src/components/widgets/background/scss/_photoinformation.scss b/src/components/widgets/background/scss/_photoinformation.scss index 8bba3f82..30131846 100644 --- a/src/components/widgets/background/scss/_photoinformation.scss +++ b/src/components/widgets/background/scss/_photoinformation.scss @@ -9,6 +9,7 @@ float: left; margin-right: 1rem; font-size: calc(10px + 2vmin); + cursor: pointer; } svg, @@ -72,10 +73,6 @@ } } -.photoInformationHover { - cursor: pointer; -} - .dark hr { background-color: white !important; } \ No newline at end of file diff --git a/src/components/widgets/greeting/Greeting.jsx b/src/components/widgets/greeting/Greeting.jsx index abecabc3..042d9d89 100644 --- a/src/components/widgets/greeting/Greeting.jsx +++ b/src/components/widgets/greeting/Greeting.jsx @@ -56,7 +56,6 @@ export default class Greeting extends React.PureComponent { } componentDidMount() { - if (localStorage.getItem('greeting') === 'false') return; this.getGreeting(); } diff --git a/src/components/widgets/navbar/Navbar.jsx b/src/components/widgets/navbar/Navbar.jsx index c4f06188..571ee800 100644 --- a/src/components/widgets/navbar/Navbar.jsx +++ b/src/components/widgets/navbar/Navbar.jsx @@ -1,10 +1,12 @@ import React from 'react'; + import RefreshIcon from '@material-ui/icons/RefreshRounded'; import Gear from '@material-ui/icons/SettingsRounded'; import NewReleases from '@material-ui/icons/NewReleasesRounded'; import NotesIcon from '@material-ui/icons/AssignmentRounded'; import Tooltip from '@material-ui/core/Tooltip'; import Report from '@material-ui/icons/SmsFailed'; + import * as Constants from '../../../modules/constants'; import './scss/index.scss'; @@ -20,6 +22,7 @@ export default class Navbar extends React.PureComponent {