misc: appropriate log type, ternary operator to prevent errors

This commit is contained in:
Isaac
2024-05-22 01:35:01 +01:00
parent 87f3024442
commit c01e4fb30d
3 changed files with 4 additions and 4 deletions

View File

@@ -22,7 +22,7 @@ class ErrorBoundary extends PureComponent {
* @returns An object with two properties: error and errorData.
*/
static getDerivedStateFromError(error) {
console.log(error);
console.error(error);
variables.stats.postEvent('modal', 'Error occurred');
return {
error: true,

View File

@@ -160,10 +160,10 @@ class Quote extends PureComponent {
'',
) || // talk page link (if applicable) is only removed for English
'Unknown';
authorimglicense = `© ${photographer}. ${license.value}`;
authorimglicense = `© ${photographer}. ${license?.value}`;
authorimglicense = authorimglicense.replace(/copyright\s/i, '').replace(/©\s©\s/, '© ');
if (license.value === 'Public domain') {
if (license?.value === 'Public domain') {
authorimglicense = null;
} else if (photographer.value === 'Unknown' || !photographer) {
authorimglicense = null;

View File

@@ -87,7 +87,7 @@ class WeatherOptions extends PureComponent {
},
(error) => {
// firefox requires this 2nd function
console.log(error);
console.error(error);
},
{
enableHighAccuracy: true,