mirror of
https://github.com/mue/mue.git
synced 2026-06-08 14:10:42 +02:00
misc: appropriate log type, ternary operator to prevent errors
This commit is contained in:
@@ -22,7 +22,7 @@ class ErrorBoundary extends PureComponent {
|
|||||||
* @returns An object with two properties: error and errorData.
|
* @returns An object with two properties: error and errorData.
|
||||||
*/
|
*/
|
||||||
static getDerivedStateFromError(error) {
|
static getDerivedStateFromError(error) {
|
||||||
console.log(error);
|
console.error(error);
|
||||||
variables.stats.postEvent('modal', 'Error occurred');
|
variables.stats.postEvent('modal', 'Error occurred');
|
||||||
return {
|
return {
|
||||||
error: true,
|
error: true,
|
||||||
|
|||||||
@@ -160,10 +160,10 @@ class Quote extends PureComponent {
|
|||||||
'',
|
'',
|
||||||
) || // talk page link (if applicable) is only removed for English
|
) || // talk page link (if applicable) is only removed for English
|
||||||
'Unknown';
|
'Unknown';
|
||||||
authorimglicense = `© ${photographer}. ${license.value}`;
|
authorimglicense = `© ${photographer}. ${license?.value}`;
|
||||||
authorimglicense = authorimglicense.replace(/copyright\s/i, '').replace(/©\s©\s/, '© ');
|
authorimglicense = authorimglicense.replace(/copyright\s/i, '').replace(/©\s©\s/, '© ');
|
||||||
|
|
||||||
if (license.value === 'Public domain') {
|
if (license?.value === 'Public domain') {
|
||||||
authorimglicense = null;
|
authorimglicense = null;
|
||||||
} else if (photographer.value === 'Unknown' || !photographer) {
|
} else if (photographer.value === 'Unknown' || !photographer) {
|
||||||
authorimglicense = null;
|
authorimglicense = null;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class WeatherOptions extends PureComponent {
|
|||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
// firefox requires this 2nd function
|
// firefox requires this 2nd function
|
||||||
console.log(error);
|
console.error(error);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
enableHighAccuracy: true,
|
enableHighAccuracy: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user