Skip to content
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
7 changes: 4 additions & 3 deletions src/components/ProjectList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ const ProjectList = () => {

useEffect(() => {
if (data?.projects?.length) {
const { projectId } = data.projects[data.projects.length - 1];
if (projectId > highestProjectId) {
setHighestProjectId(projectId);
const projectIds = data.projects.map((project: Project) => Number(project.projectId));
const maxProjectId = Math.max(...projectIds);
if (maxProjectId > highestProjectId) {
setHighestProjectId(maxProjectId);
}
}
}, [data, data?.projects, highestProjectId]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/TokenPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const TokenPreview = ({
padding: [0, 0, 'default']
}}
onClick={() => {
window.open(`${generatorUrl}/${tokenId}`);
window.open(`${generatorUrl}/${coreContractAddress?.toLowerCase()}/${tokenId}`);
}}
>
<Typography fontSize="14px" display={['none', 'none', 'block']}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/ProjectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ProjectPage = () => {
<Page>
{
projectId ? (
<ProjectDetails id={coreContractAddress + '-' + projectId} />
<ProjectDetails id={coreContractAddress?.toLowerCase() + '-' + projectId} />
) : (
<Alert severity="info">
Project not found
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
const projectQuery = (id: string) => `
query GetProject {
project(
id: "${id}"
id: "${id.toLowerCase()}"
) {
id
projectId
Expand Down