Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: querying for extraneous project Ids #437

Merged
merged 3 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/renderer/components/blocks/tables/TokenizedUnitListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const TokenizedUnitListTable: React.FC<TableProps> = ({
title: <FormattedMessage id="marketplace" />,
key: 'marketplace',
render: (row: Unit) => {
const color: string = row.marketplace === 'Tokenized on Chia' ? 'success' : 'info';
const color: string = row.marketplace?.toLowerCase() === 'tokenized on chia' ? 'success' : 'info';
return (
<div className="flex">
<Badge color={color} size="sm">
Expand All @@ -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