remove some wierdness

This commit is contained in:
Aria Moradi
2021-01-23 01:33:12 +03:30
parent dcdd50ffe1
commit 84676b9156
2 changed files with 4 additions and 12 deletions

View File

@@ -6,7 +6,6 @@ export default function Sources() {
const { setTitle } = useContext(NavBarTitle);
setTitle('Sources');
const [sources, setSources] = useState<ISource[]>([]);
let mapped;
useEffect(() => {
fetch('http://127.0.0.1:4567/api/v1/source/list')
@@ -15,10 +14,7 @@ export default function Sources() {
}, []);
if (sources.length === 0) {
mapped = <h3>wait</h3>;
} else {
mapped = sources.map((it) => <SourceCard source={it} />);
return (<h3>wait</h3>);
}
return <h2>{mapped}</h2>;
return <>{sources.map((it) => <SourceCard source={it} />)}</>;
}