Simplify
This commit is contained in:
parent
2fba5da769
commit
c1fa14f749
@ -86,17 +86,7 @@ export default function Component({ service }) {
|
|||||||
const { widget } = service;
|
const { widget } = service;
|
||||||
const { watchlist, showUSMarketStatus } = widget;
|
const { watchlist, showUSMarketStatus } = widget;
|
||||||
|
|
||||||
if (!watchlist || !watchlist.length || watchlist.length > 28) {
|
if (!watchlist || !watchlist.length || watchlist.length > 28 || new Set(watchlist).size !== watchlist.length) {
|
||||||
return (
|
|
||||||
<Container service={service}>
|
|
||||||
<Block value={t("stocks.invalidConfiguration")} />
|
|
||||||
</Container>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasDuplicates = new Set(watchlist).size !== watchlist.length;
|
|
||||||
|
|
||||||
if (hasDuplicates) {
|
|
||||||
return (
|
return (
|
||||||
<Container service={service}>
|
<Container service={service}>
|
||||||
<Block value={t("stocks.invalidConfiguration")} />
|
<Block value={t("stocks.invalidConfiguration")} />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user