Orphaned submission fix
This commit is contained in:
parent
4d11ac2382
commit
2dbb64b452
2 changed files with 10 additions and 5 deletions
|
@ -88,12 +88,12 @@ export default async function Home({
|
||||||
<h1>{content.name}</h1>
|
<h1>{content.name}</h1>
|
||||||
<p><a href={content.url} target="_blank">{content.url}</a></p>
|
<p><a href={content.url} target="_blank">{content.url}</a></p>
|
||||||
<ConditionalNull condition={submittedJam != null}>
|
<ConditionalNull condition={submittedJam != null}>
|
||||||
<p><small>Submitted by <a href={`/jams/user/${contentOwner.id}`}>{`${contentOwner.username}@${contentOwner.instance}`}</a> to <a href={`/jams/jam/${submittedJam.id}?until=${content.submitted}`}>{submittedJam.name}</a> - {new Date(parseInt(content.submitted)).toDateString()}</small></p>
|
<p><small>Submitted by <a href={`/jams/user/${contentOwner.id}`}>{`${contentOwner.username}@${contentOwner.instance}`}</a> to <a href={`/jams/jam/${submittedJam?.id}?until=${content.submitted}`}>{submittedJam?.name}</a> - {new Date(parseInt(content.submitted)).toDateString()}</small></p>
|
||||||
</ConditionalNull>
|
</ConditionalNull>
|
||||||
<ConditionalNull condition={submittedJam == null}>
|
<ConditionalNull condition={submittedJam == null}>
|
||||||
<p><small>Submitted by <a href={`/jams/user/${contentOwner.id}`}>{`${contentOwner.username}@${contentOwner.instance}`}</a> {new Date(parseInt(content.submitted)).toDateString()}</small></p>
|
<p><small>Submitted by <a href={`/jams/user/${contentOwner.id}`}>{`${contentOwner.username}@${contentOwner.instance}`}</a> {new Date(parseInt(content.submitted)).toDateString()}</small></p>
|
||||||
</ConditionalNull>
|
</ConditionalNull>
|
||||||
<ConditionalNull condition={content.winner}>
|
<ConditionalNull condition={content.winner && submittedJam != null}>
|
||||||
<p><small><b>WINNER!</b></small></p>
|
<p><small><b>WINNER!</b></small></p>
|
||||||
</ConditionalNull>
|
</ConditionalNull>
|
||||||
<p>{content.description}</p>
|
<p>{content.description}</p>
|
||||||
|
|
|
@ -146,13 +146,18 @@ export default async function Home({
|
||||||
.selectAll()
|
.selectAll()
|
||||||
.executeTakeFirst() as unknown as JSONJamTable;
|
.executeTakeFirst() as unknown as JSONJamTable;
|
||||||
|
|
||||||
if (submittedJam == null) return <p>An error occured.</p>;
|
// if (submittedJam == null) return <p>An error occured.</p>;
|
||||||
|
|
||||||
return (<div style={{
|
return (<div style={{
|
||||||
margin: "16px 0"
|
margin: "16px 0"
|
||||||
}}>
|
}}>
|
||||||
<h2><Link href={`/jams/content/${content.id}`}>{content.name}</Link></h2>
|
<h2><Link href={`/jams/content/${content.id}`}>{content.name}</Link></h2>
|
||||||
<p><small>Submitted {new Date(parseInt(content.submitted)).toDateString()} to <a href={`/jams/jam/${submittedJam.id}?until=${content.submitted}`}>{submittedJam.name}</a></small></p>
|
<ConditionalNull condition={submittedJam != null}>
|
||||||
|
<p><small>Submitted to <a href={`/jams/jam/${submittedJam?.id}?until=${content.submitted}`}>{submittedJam?.name}</a> - {new Date(parseInt(content.submitted)).toDateString()}</small></p>
|
||||||
|
</ConditionalNull>
|
||||||
|
<ConditionalNull condition={submittedJam == null}>
|
||||||
|
<p><small>Submitted on {new Date(parseInt(content.submitted)).toDateString()}</small></p>
|
||||||
|
</ConditionalNull>
|
||||||
<p>{content.description}</p>
|
<p>{content.description}</p>
|
||||||
</div>);
|
</div>);
|
||||||
})}
|
})}
|
||||||
|
@ -187,7 +192,7 @@ export default async function Home({
|
||||||
margin: "16px 0"
|
margin: "16px 0"
|
||||||
}}>
|
}}>
|
||||||
<h2><a href={`/jams/content/${judgement.content_id}?until=${judgement.published}`}>{`${judgementOwner.username}@${judgementOwner.instance}`}</a></h2>
|
<h2><a href={`/jams/content/${judgement.content_id}?until=${judgement.published}`}>{`${judgementOwner.username}@${judgementOwner.instance}`}</a></h2>
|
||||||
<p><small>Published {new Date(parseInt(judgement.published)).toDateString()} on <a href={`/jams/content/${submittedContent.id}?until=${judgement.published}`}>{submittedContent.name}</a></small></p>
|
<p><small>Published on {new Date(parseInt(judgement.published)).toDateString()} on <a href={`/jams/content/${submittedContent.id}?until=${judgement.published}`}>{submittedContent.name}</a></small></p>
|
||||||
<p>{judgement.content}</p>
|
<p>{judgement.content}</p>
|
||||||
</div>);
|
</div>);
|
||||||
})}
|
})}
|
||||||
|
|
Loading…
Reference in a new issue