fix bug and show prompt

This commit is contained in:
Abi Raja 2023-12-07 09:22:22 -05:00
parent 0e8eef4554
commit 874afc1e66
2 changed files with 7 additions and 2 deletions

View File

@ -155,7 +155,7 @@ function App() {
} else { } else {
setAppHistory((prev) => { setAppHistory((prev) => {
// Validate parent version // Validate parent version
if (!parentVersion) { if (parentVersion === null) {
toast.error( toast.error(
"No parent version set. Contact support or open a Github issue." "No parent version set. Contact support or open a Github issue."
); );

View File

@ -30,7 +30,7 @@ export default function HistoryDisplay({
}: Props) { }: Props) {
return history.length === 0 ? null : ( return history.length === 0 ? null : (
<div className="flex flex-col h-screen"> <div className="flex flex-col h-screen">
<h1 className="font-bold mb-2">History</h1> <h1 className="font-bold mb-2">Versions</h1>
<ScrollArea className="flex-1 overflow-y-auto"> <ScrollArea className="flex-1 overflow-y-auto">
<ul className="space-y-0 flex flex-col-reverse"> <ul className="space-y-0 flex flex-col-reverse">
{history.map((item, index) => ( {history.map((item, index) => (
@ -58,6 +58,11 @@ export default function HistoryDisplay({
<h2 className="text-sm">(parent: v{item.parent + 1})</h2> <h2 className="text-sm">(parent: v{item.parent + 1})</h2>
)} )}
</div> </div>
<h2 className="text-sm">
{item.type === "ai_edit"
? item.inputs.prompt
: item.inputs.image_url}
</h2>
<h2 className="text-sm">v{index + 1}</h2> <h2 className="text-sm">v{index + 1}</h2>
</li> </li>
))} ))}