Skip to content

Commit

Permalink
FIX: Reports could not be closed (#2463)
Browse files Browse the repository at this point in the history
  • Loading branch information
JindrichSusen committed Feb 8, 2024
1 parent 11d8105 commit 03993ee
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -44,9 +44,11 @@ export function onScreenTabCloseClick(ctx: any) {
return flow(function*onFormTabCloseClick(event: any, closeWithoutSaving?: boolean) {
const openedScreen = getOpenedScreen(ctx);
const formScreen = openedScreen.content?.formScreen;
const lifecycle = getFormScreenLifecycle(openedScreen.content.formScreen!);
if(formScreen?.showWorkflowNextButton) {
return yield*lifecycle.onWorkflowAbortClick(null);
if(formScreen){
const lifecycle = getFormScreenLifecycle(formScreen);
if(formScreen?.showWorkflowNextButton) {
return yield*lifecycle.onWorkflowAbortClick(null);
}
}
let dataViews = openedScreen.content?.formScreen?.dataViews ?? [];
for (const dataView of dataViews) {
Expand All @@ -59,6 +61,7 @@ export function onScreenTabCloseClick(ctx: any) {
closingScreens.add(openedScreen);
// TODO: Better lifecycle handling
if (openedScreen.content && !openedScreen.content.isLoading) {
const lifecycle = getFormScreenLifecycle(openedScreen.content.formScreen!);
yield*lifecycle.onRequestScreenClose(closeWithoutSaving);
} else {
yield*closeForm(ctx)();
Expand Down

0 comments on commit 03993ee

Please sign in to comment.