mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-06 02:00:46 +00:00
fixed "view result" link on jobs loading new document on click
This commit is contained in:
1 parent
857e604833
commit
056f3166af
2 files changed
+13
-3
No files matched your search
@@ -3,6 +3,7 @@ import { a, useSpring } from "@react-spring/web";
|
||||
import { WorkIndicator } from 'components/svg';
|
||||
import { FrontendInferenceJobType, InferenceJob } from "@storyteller/components/src/jobs/InferenceJob";
|
||||
import { JobState } from "@storyteller/components/src/jobs/JobStates";
|
||||
import { useHistory } from "react-router-dom";
|
||||
|
||||
// import { useInterval } from "hooks"; // for animation debugging
|
||||
|
||||
@@ -15,9 +16,15 @@ interface JobListItem extends InferenceJob {
|
||||
}
|
||||
|
||||
|
||||
const OuterItem = ({ className, children, success, jobToken, maybeResultToken, onSelect = () => {}, refSet }: { className?: string, children?: any, jobToken: string, success: boolean, maybeResultToken?: any, onSelect?: any, refSet?: any }) => success ?
|
||||
<a.a {...{ className, href: `/media/${maybeResultToken}`, id: `ijobitem-${ jobToken }`, onClick: () => onSelect(), ref: refSet }}>{ children }</a.a> :
|
||||
<a.div {...{ className, id: `ijobitem-${ jobToken }`, ref: refSet }}>{ children }</a.div>;
|
||||
const OuterItem = ({ className, children, success, jobToken, maybeResultToken, onSelect = () => {}, refSet }: { className?: string, children?: any, jobToken: string, success: boolean, maybeResultToken?: any, onSelect?: any, refSet?: any }) => {
|
||||
const history = useHistory();
|
||||
return success ?
|
||||
<a.div {...{ className, id: `ijobitem-${ jobToken }`, onClick: () => {
|
||||
history.push(`/media/${maybeResultToken}`);
|
||||
onSelect();
|
||||
}, ref: refSet }}>{ children }</a.div> :
|
||||
<a.div {...{ className, id: `ijobitem-${ jobToken }`, ref: refSet }}>{ children }</a.div>;
|
||||
}
|
||||
|
||||
export default function JobItem({ failures, frontendJobType, maybeFailureCategory, maybeResultToken, onSelect, jobToken, jobState, jobStatusDescription, refSet, t, ...rest }: JobListItem) {
|
||||
const [hasBounced,hasBouncedSet] = useState(false);
|
||||
|
||||
@@ -37,6 +37,9 @@ export default function InferenceJobsModal({ handleClose, jobType: inJobType = -
|
||||
}
|
||||
<InferenceJobsList {...{
|
||||
failures,
|
||||
onSelect: () => {
|
||||
if (handleClose) handleClose();
|
||||
},
|
||||
value: 0 // fixed for now
|
||||
// value: typeObj.indexOf(jobType),
|
||||
}} />
|
||||
|
||||
Reference in new issue
Block a user