just reuse allowRedirect.
This commit is contained in:
parent
375e6febe9
commit
2be9bb6267
|
@ -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`);
|
||||
}
|
||||
|
||||
|
|
|
@ -1113,7 +1113,6 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
|
|||
<ProcessInterstitial
|
||||
processInstanceId={processInstance.id}
|
||||
processInstanceShowPageUrl={processInstanceShowPageBaseUrl}
|
||||
redirectToHomeWhenNoTasks={false}
|
||||
allowRedirect={false}
|
||||
/>
|
||||
<br />
|
||||
|
|
Loading…
Reference in New Issue