just reuse allowRedirect.
This commit is contained in:
parent
375e6febe9
commit
2be9bb6267
|
@ -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`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 />
|
||||||
|
|
Loading…
Reference in New Issue