just reuse allowRedirect.

This commit is contained in:
danfunk 2023-05-31 10:28:16 -04:00
parent 375e6febe9
commit 2be9bb6267
2 changed files with 1 additions and 4 deletions

View File

@ -15,14 +15,12 @@ type OwnProps = {
processInstanceId: number; processInstanceId: number;
processInstanceShowPageUrl: string; processInstanceShowPageUrl: string;
allowRedirect: boolean; allowRedirect: boolean;
redirectToHomeWhenNoTasks?: boolean;
}; };
export default function ProcessInterstitial({ export default function ProcessInterstitial({
processInstanceId, processInstanceId,
allowRedirect, allowRedirect,
processInstanceShowPageUrl, processInstanceShowPageUrl,
redirectToHomeWhenNoTasks = true,
}: OwnProps) { }: OwnProps) {
const [data, setData] = useState<any[]>([]); const [data, setData] = useState<any[]>([]);
const [lastTask, setLastTask] = useState<any>(null); const [lastTask, setLastTask] = useState<any>(null);
@ -162,7 +160,7 @@ export default function ProcessInterstitial({
/** In the event there is no task information and the connection closed, /** In the event there is no task information and the connection closed,
* redirect to the home page. */ * redirect to the home page. */
if (state === 'CLOSED' && lastTask === null && redirectToHomeWhenNoTasks) { if (state === 'CLOSED' && lastTask === null && allowRedirect) {
navigate(`/tasks`); navigate(`/tasks`);
} }

View File

@ -1113,7 +1113,6 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
<ProcessInterstitial <ProcessInterstitial
processInstanceId={processInstance.id} processInstanceId={processInstance.id}
processInstanceShowPageUrl={processInstanceShowPageBaseUrl} processInstanceShowPageUrl={processInstanceShowPageBaseUrl}
redirectToHomeWhenNoTasks={false}
allowRedirect={false} allowRedirect={false}
/> />
<br /> <br />