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;
processInstanceShowPageUrl: string;
allowRedirect: boolean;
redirectToHomeWhenNoTasks?: boolean;
};
export default function ProcessInterstitial({
processInstanceId,
allowRedirect,
processInstanceShowPageUrl,
redirectToHomeWhenNoTasks = true,
}: OwnProps) {
const [data, setData] = useState<any[]>([]);
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,
* redirect to the home page. */
if (state === 'CLOSED' && lastTask === null && redirectToHomeWhenNoTasks) {
if (state === 'CLOSED' && lastTask === null && allowRedirect) {
navigate(`/tasks`);
}

View File

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