These bugs fix warnings/errors I saw in the console log.

* Fixed broken reference to toast language
* Fixed null reference for a hidden credits section.
* Fixed case when "notes" is not defined in local storage.
* Corrected scope of "this" on Notes.jsx
This commit is contained in:
MrOnosa
2020-10-18 07:40:41 -05:00
parent 93edb489f7
commit 5dc8bbf963
3 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ export default class MainModal extends React.PureComponent {
constructor(...args) {
super(...args);
this.state = {
tab: <Settings language={this.props.language.settings} toastLanguage={this.props.toastLanguage} />,
tab: <Settings language={this.props.language.settings} toastLanguage={this.props.language.toasts} />,
settingsActive: 'active',
addonsActive: '',
marketplaceActive: ''

View File

@@ -34,7 +34,7 @@ export default class Background extends React.PureComponent {
`${background}; -webkit-filter: blur(${localStorage.getItem('blur')}px) brightness(${brightness}%);`
);
if (credit === 'false') document.querySelector('#credits').style.display = 'none'; // Hide the credit
if (credit === 'false' && document.querySelector('#credits')) document.querySelector('#credits').style.display = 'none'; // Hide the credit
}
setCredit(photographer, unsplash, url) {

View File

@@ -8,11 +8,11 @@ export default class Notes extends React.PureComponent {
constructor(...args) {
super(...args);
this.state = {
notes: localStorage.getItem('notes')
notes: localStorage.getItem('notes') || ""
};
}
setNotes(e) {
setNotes = (e) => {
localStorage.setItem('notes', e.target.value);
this.setState({ notes: e.target.value });
};