Skip to content

Commit

Permalink
fix: querying for extraneous project Ids
Browse files Browse the repository at this point in the history
  • Loading branch information
wwills2 committed Jan 29, 2025
1 parent c35215b commit 1795708
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
10 changes: 2 additions & 8 deletions src/renderer/components/blocks/tables/TokenizedUnitListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,8 @@ const TokenizedUnitListTable: React.FC<TableProps> = ({
render: (unit: Unit) => (
<Tooltip content={unit.marketplaceLink}>
<div style={{ maxWidth: '310px' }}>
<p className="text-left text-ellipsis w-full overflow-hidden whitespace-nowrap">
{unit.marketplaceLink ? (
unit.marketplaceLink
) : (
<p className="capitalize">
<FormattedMessage id="not-specified" />
</p>
)}
<p className="text-left text-ellipsis w-full overflow-hidden whitespace-nowrap capitalize">
{unit.marketplaceLink ? unit.marketplaceLink : <FormattedMessage id="not-specified" />}
</p>
</div>
</Tooltip>
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/components/blocks/tabs/TokenizedUnitsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ const TokenizedUnitsTab: React.FC<PageTabProps> = ({ search, order, setOrder }:
!projectsResponse
) {
const projectIds: string[] = tokenizedUnitsResponse.data.reduce<string[]>((projectIds: string[], unit: Unit) => {
if (unit?.issuance?.warehouseProjectId) {
projectIds.push(unit?.issuance?.warehouseProjectId);
const warehouseProjectId = unit?.issuance?.warehouseProjectId;
if (warehouseProjectId && !projectIds.includes(warehouseProjectId)) {
projectIds.push(warehouseProjectId);
}
return projectIds;
}, []);
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/components/blocks/tabs/UntokenizedUnitsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ const UntokenizedUnitsTab: React.FC<PageTabProps> = ({
) {
const projectIds: string[] = untokenizedUnitsResponse.data.reduce<string[]>(
(projectIds: string[], unit: Unit) => {
if (unit?.issuance?.warehouseProjectId) {
projectIds.push(unit?.issuance?.warehouseProjectId);
const warehouseProjectId = unit?.issuance?.warehouseProjectId;
if (warehouseProjectId && !projectIds.includes(warehouseProjectId)) {
projectIds.push(warehouseProjectId);
}
return projectIds;
},
Expand Down

0 comments on commit 1795708

Please sign in to comment.