@@ -191,7 +191,7 @@ class Item extends PureComponent {
>
- ) : null}
+ )}
{variables.getMessage('modals.main.marketplace.product.description')}
@@ -223,7 +223,7 @@ class Item extends PureComponent {
{this.props.data.author}
- {this.props.data.data.quotes ? (
+ {this.props.data.data.quotes && (
@@ -233,8 +233,8 @@ class Item extends PureComponent {
{this.props.data.data.quotes.length}
- ) : null}
- {this.props.data.data.photos ? (
+ )}
+ {this.props.data.data.photos && (
@@ -244,7 +244,7 @@ class Item extends PureComponent {
{this.props.data.data.photos.length}
- ) : null}
+ )}
{this.props.data.data.quotes && this.props.data.data.language !== '' ? (
@@ -312,7 +312,7 @@ class Item extends PureComponent {
- {this.props.data.data.collection ? (
+ {this.props.data.data.collection && (
{variables.getMessage('modals.main.marketplace.product.part_of')}
@@ -320,7 +320,7 @@ class Item extends PureComponent {
{this.props.data.data.collection}
{variables.getMessage('modals.main.marketplace.product.explore')}
- ) : null}
+ )}
diff --git a/src/components/modals/main/marketplace/sections/Create.jsx b/src/components/modals/main/marketplace/sections/Create.jsx
index 09289b03..cac66197 100644
--- a/src/components/modals/main/marketplace/sections/Create.jsx
+++ b/src/components/modals/main/marketplace/sections/Create.jsx
@@ -27,7 +27,7 @@ export default class Create extends PureComponent {
{variables.getMessage('modals.main.addons.create.moved_description')}
- {variables.getMessage('modals.main.addons.create.moved_button')}
+ Coming soon...
diff --git a/src/components/modals/main/marketplace/sections/Marketplace.jsx b/src/components/modals/main/marketplace/sections/Marketplace.jsx
index dad4f27f..e9a012fd 100644
--- a/src/components/modals/main/marketplace/sections/Marketplace.jsx
+++ b/src/components/modals/main/marketplace/sections/Marketplace.jsx
@@ -395,7 +395,7 @@ class Marketplace extends PureComponent {
- {this.props.type !== 'collections' ? (
+ {this.props.type !== 'collections' && (
- ) : null}
+ )}
{
- return e ? (
+ return e && (
{e.props ? e.props.children : ''}
- ) : null;
+ );
})}
diff --git a/src/components/modals/main/settings/Header.jsx b/src/components/modals/main/settings/Header.jsx
index aaa8660e..dd29e880 100644
--- a/src/components/modals/main/settings/Header.jsx
+++ b/src/components/modals/main/settings/Header.jsx
@@ -10,7 +10,6 @@ import {
} from 'react-icons/md';
import Slider from './Slider';
-import Switch from './Switch';
import SettingsItem from './SettingsItem';
import EventBus from 'modules/helpers/eventbus';
@@ -53,7 +52,7 @@ class Header extends PureComponent {
return (
<>
- {this.props.backButton ? (
+ {this.props.backButton && (
- ) : null}
+ )}
{this.props.title}
{this.props.switch && (
{variables.getMessage('modals.main.settings.sections.header.report_issue')}
- {this.props.zoomSetting ? (
+ {this.props.zoomSetting && (
- ) : null}
+ )}
>
);
}
diff --git a/src/components/modals/main/settings/sections/Advanced.jsx b/src/components/modals/main/settings/sections/Advanced.jsx
index a32a3661..6b85f9ad 100644
--- a/src/components/modals/main/settings/sections/Advanced.jsx
+++ b/src/components/modals/main/settings/sections/Advanced.jsx
@@ -39,7 +39,7 @@ export default class AdvancedSettings extends PureComponent {
>
- {localStorage.getItem('welcomePreview') !== 'true' ? (
+ {localStorage.getItem('welcomePreview') !== 'true' && (
@@ -64,7 +64,7 @@ export default class AdvancedSettings extends PureComponent {
- ) : null}
+ )}
{this.state.author} • {this.state.date}
- {this.state.image ? (
+ {this.state.image && (
- ) : null}
+ )}
{this.state.content}
))}
- {this.state.messages.length === 0 ? (
+ {this.state.messages.length === 0 && (
@@ -128,7 +128,7 @@ export default class Message extends PureComponent {
- ) : null}
+ )}
>
);
}
diff --git a/src/components/modals/main/settings/sections/Navbar.jsx b/src/components/modals/main/settings/sections/Navbar.jsx
index 37738213..566b1b57 100644
--- a/src/components/modals/main/settings/sections/Navbar.jsx
+++ b/src/components/modals/main/settings/sections/Navbar.jsx
@@ -56,7 +56,7 @@ function Navbar() {
category="navbar"
/>
- {showRefreshOptions ? (
+ {showRefreshOptions && (
- ) : null}
+ )}
>
);
}
diff --git a/src/components/modals/main/settings/sections/QuickLinks.jsx b/src/components/modals/main/settings/sections/QuickLinks.jsx
index d84f5196..6a8aefcc 100644
--- a/src/components/modals/main/settings/sections/QuickLinks.jsx
+++ b/src/components/modals/main/settings/sections/QuickLinks.jsx
@@ -39,7 +39,7 @@ export default class QuickLinks extends PureComponent {
variables.stats.postEvent('feature', 'Quicklink delete');
}
- addLink(name, url, icon) {
+ async addLink(name, url, icon) {
const data = JSON.parse(localStorage.getItem('quicklinks'));
// regex: https://ihateregex.io/expr/url/
@@ -63,7 +63,7 @@ export default class QuickLinks extends PureComponent {
}
data.push({
- name: name || url,
+ name: name || await this.getTitle(url),
url,
icon: icon || '',
key: Math.random().toString(36).substring(7) + 1,
@@ -89,10 +89,10 @@ export default class QuickLinks extends PureComponent {
});
}
- editLink(og, name, url, icon) {
+ async editLink(og, name, url, icon) {
const data = JSON.parse(localStorage.getItem('quicklinks'));
const dataobj = data.find((i) => i.key === og.key);
- dataobj.name = name || url;
+ dataobj.name = name || await this.getTitle(url);
dataobj.url = url;
dataobj.icon = icon || '';
@@ -105,6 +105,24 @@ export default class QuickLinks extends PureComponent {
});
}
+ async getTitle(url) {
+ let title;
+ try {
+ let response = await fetch(url);
+ if (response.redirected) {
+ response = await fetch(response.url);
+ }
+ const html = await response.text();
+ const parser = new DOMParser();
+ const doc = parser.parseFromString(html, 'text/html');
+ title = doc.title;
+ } catch (e) {
+ title = url;
+ }
+
+ return title;
+ }
+
componentDidMount() {
EventBus.on('refresh', (data) => {
if (data === 'quicklinks') {
@@ -255,7 +273,7 @@ export default class QuickLinks extends PureComponent {
- {this.state.items.length === 0 ? (
+ {this.state.items.length === 0 && (
@@ -271,7 +289,7 @@ export default class QuickLinks extends PureComponent {
- ) : null}
+ )}
{this.state.items.map((item) => quickLink(item))}
diff --git a/src/components/modals/main/settings/sections/Quote.jsx b/src/components/modals/main/settings/sections/Quote.jsx
index 4e5a4674..5db9af60 100644
--- a/src/components/modals/main/settings/sections/Quote.jsx
+++ b/src/components/modals/main/settings/sections/Quote.jsx
@@ -220,7 +220,7 @@ export default class QuoteSettings extends PureComponent {
- {!this.state.sourceSection ? (
+ {!this.state.sourceSection && (
<>
>
- ) : null}
+ )}
{customSettings}
>
);
diff --git a/src/components/modals/main/settings/sections/advanced/Advanced.jsx b/src/components/modals/main/settings/sections/advanced/Advanced.jsx
index 691aa577..15727e70 100644
--- a/src/components/modals/main/settings/sections/advanced/Advanced.jsx
+++ b/src/components/modals/main/settings/sections/advanced/Advanced.jsx
@@ -67,7 +67,7 @@ export default class AdvancedSettings extends PureComponent {
>
- {localStorage.getItem('welcomePreview') !== 'true' ? (
+ {localStorage.getItem('welcomePreview') !== 'true' && (
@@ -92,7 +92,7 @@ export default class AdvancedSettings extends PureComponent {
- ) : null}
+ )}
this.setState({ backgroundType: value })}
category="background"
>
- {this.state.marketplaceEnabled ? (
+ {this.state.marketplaceEnabled && (
{variables.getMessage('modals.main.navbar.marketplace')}
- ) : null}
+ )}
{variables.getMessage('modals.main.settings.sections.background.type.api')}
@@ -406,11 +406,11 @@ export default class BackgroundSettings extends PureComponent {
onChange={(value) => this.setState({ backgroundType: value })}
category="background"
>
- {this.state.marketplaceEnabled ? (
+ {this.state.marketplaceEnabled && (
{variables.getMessage('modals.main.navbar.marketplace')}
- ) : null}
+ )}
{variables.getMessage('modals.main.settings.sections.background.type.api')}
@@ -520,7 +520,7 @@ export default class BackgroundSettings extends PureComponent {
)}
- {this.state.backgroundFilter !== 'none' ? (
+ {this.state.backgroundFilter !== 'none' && (
- ) : null}
+ )}
) : null}
>
diff --git a/src/components/modals/main/settings/sections/background/Colour.jsx b/src/components/modals/main/settings/sections/background/Colour.jsx
index aca1fd60..af8089c7 100644
--- a/src/components/modals/main/settings/sections/background/Colour.jsx
+++ b/src/components/modals/main/settings/sections/background/Colour.jsx
@@ -207,13 +207,13 @@ export default class ColourSettings extends PureComponent {
colourSettings = (
<>
{gradientInputs}
- {!gradientHasMoreThanOneColour ? (
+ {!gradientHasMoreThanOneColour && (
<>
{variables.getMessage('modals.main.settings.sections.background.source.add_colour')}
>
- ) : null}
+ )}
>
);
}
diff --git a/src/components/modals/main/settings/sections/background/Custom.jsx b/src/components/modals/main/settings/sections/background/Custom.jsx
index 3cd8bea1..8cc79441 100644
--- a/src/components/modals/main/settings/sections/background/Custom.jsx
+++ b/src/components/modals/main/settings/sections/background/Custom.jsx
@@ -227,8 +227,8 @@ export default class CustomSettings extends PureComponent {
alt={'Custom background ' + (index || 0)}
src={`${!this.videoCheck(url) ? this.state.customBackground[index] : ''}`}
/>
- {this.videoCheck(url) ? : null}
- {this.state.customBackground.length > 0 ? (
+ {this.videoCheck(url) && }
+ {this.state.customBackground.length > 0 && (
- ) : null}
+ )}
))}
diff --git a/src/components/modals/main/tabs/backend/Tab.jsx b/src/components/modals/main/tabs/backend/Tab.jsx
index b615d863..94776ee7 100644
--- a/src/components/modals/main/tabs/backend/Tab.jsx
+++ b/src/components/modals/main/tabs/backend/Tab.jsx
@@ -154,11 +154,11 @@ function Tab({ label, currentTab, onClick, navbarTab }) {
return (
<>
- {mue === true ? Mue : null}
+ {mue === true && Mue }
onClick(label)}>
{icon} {label}
- {divider === true ? : null}
+ {divider === true && }
>
);
}
diff --git a/src/components/modals/welcome/WelcomeSections.jsx b/src/components/modals/welcome/WelcomeSections.jsx
index add037e2..22d07561 100644
--- a/src/components/modals/welcome/WelcomeSections.jsx
+++ b/src/components/modals/welcome/WelcomeSections.jsx
@@ -391,14 +391,14 @@ class WelcomeSections extends PureComponent {
)}
- {this.state.importedSettings.length !== 0 ? (
+ {this.state.importedSettings.length !== 0 && (
this.props.switchTab(2)}>
{variables.getMessage('modals.main.settings.sections.final.imported', {
amount: this.state.importedSettings.length,
})}{' '}
{this.state.importedSettings.length}
- ) : null}
+ )}
>
);
diff --git a/src/components/widgets/Widgets.jsx b/src/components/widgets/Widgets.jsx
index 27a4a7ec..f407f411 100644
--- a/src/components/widgets/Widgets.jsx
+++ b/src/components/widgets/Widgets.jsx
@@ -26,12 +26,12 @@ export default class Widgets extends PureComponent {
};
// widgets we can re-order
this.widgets = {
- time: this.enabled('time') ? : null,
- greeting: this.enabled('greeting') ? : null,
- quote: this.enabled('quote') ?
: null,
- date: this.enabled('date') ? : null,
+ time: this.enabled('time') && ,
+ greeting: this.enabled('greeting') && ,
+ quote: this.enabled('quote') &&
,
+ date: this.enabled('date') && ,
quicklinks: this.enabled('quicklinksenabled') && this.online ? : null,
- message: this.enabled('message') ? : null,
+ message: this.enabled('message') && ,
};
}
@@ -77,7 +77,7 @@ export default class Widgets extends PureComponent {
) : (
- {!info.offline ? (
+ {!info.offline && (
openShareModal(true)} />
- ) : null}
+ )}
- {!info.offline ? (
+ {!info.offline && (
downloadImage(info)} />
- ) : null}
- {info.pun ? (
+ )}
+ {info.pun && (
openExcludeModal(true)} />
- ) : null}
+ )}
>
) : null}
diff --git a/src/components/widgets/navbar/Navbar.jsx b/src/components/widgets/navbar/Navbar.jsx
index fb407bf7..dc01c7dd 100644
--- a/src/components/widgets/navbar/Navbar.jsx
+++ b/src/components/widgets/navbar/Navbar.jsx
@@ -103,14 +103,14 @@ class Navbar extends PureComponent {
{localStorage.getItem('view') === 'true' && backgroundEnabled ? (
) : null}
- {localStorage.getItem('notesEnabled') === 'true' ? (
+ {localStorage.getItem('notesEnabled') === 'true' && (
- ) : null}
- {localStorage.getItem('todoEnabled') === 'true' ? (
+ )}
+ {localStorage.getItem('todoEnabled') === 'true' && (
- ) : null}
+ )}
- {this.refreshEnabled !== 'false' ? (
+ {this.refreshEnabled !== 'false' && (
- ) : null}
+ )}
{this.state.author}
- {this.state.authorOccupation !== 'Unknown' ? (
+ {this.state.authorOccupation !== 'Unknown' && (
{this.state.authorOccupation}
- ) : null}
+ )}
- {this.state.authorimglicense
- ? this.state.authorimglicense.replace(' undefined. ', ' ')
- : null}
+ {this.state.authorimglicense &&
+ this.state.authorimglicense.replace(' undefined. ', ' ')}
) : (
diff --git a/src/components/widgets/search/Search.jsx b/src/components/widgets/search/Search.jsx
index af4b9abf..4175602e 100644
--- a/src/components/widgets/search/Search.jsx
+++ b/src/components/widgets/search/Search.jsx
@@ -249,7 +249,7 @@ export default class Search extends PureComponent {
{localStorage.getItem('searchDropdown') === 'true' &&
- this.state.searchDropdown === true ? (
+ this.state.searchDropdown === true && (
{searchEngines.map(({ name }, key) => {
return (
@@ -275,7 +275,7 @@ export default class Search extends PureComponent {
{customText}
- ) : null}
+ )}
);
diff --git a/src/components/widgets/weather/Expanded.jsx b/src/components/widgets/weather/Expanded.jsx
index 186c110d..2263a6ca 100644
--- a/src/components/widgets/weather/Expanded.jsx
+++ b/src/components/widgets/weather/Expanded.jsx
@@ -27,7 +27,7 @@ function Expanded({ state, weatherType, variables }) {
{variables.getMessage('widgets.weather.extra_information')}
)}
- {enabled('cloudiness') ? (
+ {enabled('cloudiness') && (
- ) : null}
- {enabled('windspeed') ? (
+ )}
+ {enabled('windspeed') && (
{state.weather.wind_speed}
m/s {' '}
- {enabled('windDirection') ? (
+ {enabled('windDirection') && (
- ) : null}
+ )}
- ) : null}
- {enabled('atmosphericpressure') ? (
+ )}
+ {enabled('atmosphericpressure') && (
hPa
- ) : null}
- {enabled('weatherdescription') ? (
+ )}
+ {enabled('weatherdescription') && (
- ) : null}
- {enabled('visibility') ? (
+ )}
+ {enabled('visibility') && (
- ) : null}
- {enabled('humidity') ? (
+ )}
+ {enabled('humidity') && (
- ) : null}
+ )}
);
}
diff --git a/src/components/widgets/weather/Weather.jsx b/src/components/widgets/weather/Weather.jsx
index 3a2db309..d3c4a035 100644
--- a/src/components/widgets/weather/Weather.jsx
+++ b/src/components/widgets/weather/Weather.jsx
@@ -135,9 +135,9 @@ export default class Weather extends PureComponent {
{this.state.location}
)}
- {weatherType >= 3 ? (
+ {weatherType >= 3 && (
- ) : null}
+ )}
);
}
diff --git a/src/components/widgets/weather/WindDirectionIcon.jsx b/src/components/widgets/weather/WindDirectionIcon.jsx
index 5b0c5191..36ffd5bd 100644
--- a/src/components/widgets/weather/WindDirectionIcon.jsx
+++ b/src/components/widgets/weather/WindDirectionIcon.jsx
@@ -52,7 +52,7 @@ function WindDirectionIcon({ degrees }) {
const direction =
directions[Math.round(((degrees %= 360) < 0 ? degrees + 360 : degrees) / 45) % 8];
- return direction ? direction.icon : null;
+ return direction && direction.icon;
}
WindDirectionIcon.propTypes = {
diff --git a/src/modules/constants.js b/src/modules/constants.js
index c988b6da..36315645 100644
--- a/src/modules/constants.js
+++ b/src/modules/constants.js
@@ -26,11 +26,11 @@ export const REPO_NAME = 'mue';
export const EMAIL = 'hello@muetab.com';
export const TWITTER_HANDLE = 'getmue';
export const DISCORD_SERVER = 'zv8C9F8';
-export const COPYRIGHT_NAME = 'The Mue Authors';
+export const COPYRIGHT_NAME = 'The Mue Authors & Kaiso One Ltd';
export const COPYRIGHT_YEAR = '2018';
export const COPYRIGHT_LICENSE = 'BSD-3-Clause License';
export const OPENCOLLECTIVE_USERNAME = 'mue';
export const OFFLINE_IMAGES = 20;
-export const VERSION = '7.0.0';
+export const VERSION = '7.0.1';