🔧 Fixed jankiness with Downloads Panel

This commit is contained in:
2021-12-06 08:42:24 -08:00
parent e6952b44bf
commit 1b57092d3b
2 changed files with 37 additions and 36 deletions

View File

@@ -44,9 +44,6 @@ export const ComicVineMatchPanel = (comicVineData): ReactElement => {
</div> </div>
</div> </div>
</div> </div>
<div className="search-results-container"> <div className="search-results-container">
{!isEmpty(comicVineSearchResults) && ( {!isEmpty(comicVineSearchResults) && (
<MatchResult <MatchResult

View File

@@ -37,14 +37,14 @@ export const DownloadsPanel = (
if (!isEmpty(userSettings)) { if (!isEmpty(userSettings)) {
dispatch( dispatch(
getBundlesForComic(props.comicObjectId, ADCPPSocket, { getBundlesForComic(props.comicObjectId, ADCPPSocket, {
username: `${userSettings.directConnect.client.username}`, username: `${userSettings.directConnect.client.host.username}`,
password: `${userSettings.directConnect.client.password}`, password: `${userSettings.directConnect.client.host.password}`,
}), }),
); );
dispatch( dispatch(
getDownloadProgress(props.comicObjectId, ADCPPSocket, { getDownloadProgress(props.comicObjectId, ADCPPSocket, {
username: `${userSettings.directConnect.client.username}`, username: `${userSettings.directConnect.client.host.username}`,
password: `${userSettings.directConnect.client.password}`, password: `${userSettings.directConnect.client.host.password}`,
}), }),
); );
} }
@@ -89,7 +89,8 @@ export const DownloadsPanel = (
}; };
const Bundles = (props) => { const Bundles = (props) => {
return ( return !isEmpty(props.data) ? (
<div className="column is-full">
<table className="table is-striped"> <table className="table is-striped">
<thead> <thead>
<tr> <tr>
@@ -99,9 +100,7 @@ export const DownloadsPanel = (
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{!isNil(props.data) && {map(props.data, (bundle) => (
props.data &&
map(props.data, (bundle) => (
<tr key={bundle.id}> <tr key={bundle.id}>
<td> <td>
<h5>{ellipsize(bundle.name, 58)}</h5> <h5>{ellipsize(bundle.name, 58)}</h5>
@@ -117,14 +116,18 @@ export const DownloadsPanel = (
))} ))}
</tbody> </tbody>
</table> </table>
</div>
) : (
<div className="column is-full"> {"No Downloads Found"} </div>
); );
}; };
return !isNil(props.data) ? ( return !isNil(props.data) ? (
<div className="columns"> <>
{!isNil(downloadProgressTick) ? ( {!isNil(downloadProgressTick) ? (
<ProgressTick data={downloadProgressTick} /> <ProgressTick data={downloadProgressTick} />
) : null} ) : null}
<div className="columns">
{!isEmpty(ADCPPSocket) ? ( {!isEmpty(ADCPPSocket) ? (
<Bundles data={bundles} /> <Bundles data={bundles} />
) : ( ) : (
@@ -138,6 +141,7 @@ export const DownloadsPanel = (
</div> </div>
)} )}
</div> </div>
</>
) : null; ) : null;
}; };