@@ -45,6 +45,7 @@ const MainLayout = ({ children }: MainLayoutProps) => {
4545
4646 const [ bgImgSrc , setBgImgSrc ] = useState < string > ( "" ) ;
4747 const isCheckedRunCount = useRef ( false ) ;
48+ const isCheckedLastRunStatus = useRef ( false ) ;
4849
4950 const {
5051 isOpen : isWelcomeAndTermsModalOpen ,
@@ -63,17 +64,21 @@ const MainLayout = ({ children }: MainLayoutProps) => {
6364 title : t ( "UnavailableExePathAlertDialog.dialog.title" ) ,
6465 body : t ( "UnavailableExePathAlertDialog.dialog.content" ) ,
6566 btnCancel : t ( "UnavailableExePathAlertDialog.dialog.btnContinue" ) ,
67+ onCancelCallback : ( ) => update ( "runCount" , config . runCount + 1 ) , // because this dialog will skip the run count check
6668 btnOK : t ( "General.exit" ) ,
67- isAlert : true ,
6869 onOKCallback : ( ) => exit ( 0 ) ,
6970 footerLeft : (
7071 < HStack spacing = { 2 } >
7172 < LuLanguages />
7273 < LanguageMenu placement = "top" />
7374 </ HStack >
7475 ) ,
76+ isAlert : true ,
77+ closeOnEsc : false ,
78+ closeOnOverlayClick : false ,
79+ showCloseBtn : false ,
7580 } ) ;
76- } , [ openGenericConfirmDialog ] ) ;
81+ } , [ config . runCount , openGenericConfirmDialog , update ] ) ;
7782
7883 const openLastExitedAbnormallyDialog = useCallback ( ( ) => {
7984 openGenericConfirmDialog ( {
@@ -132,11 +137,12 @@ const MainLayout = ({ children }: MainLayoutProps) => {
132137 }
133138
134139 // update `last_run_exited_normally` to false, will be updated when this run ends with normal exit.
135- if ( ! config . mocked && ! isCheckedRunCount . current && ! isStandAlone ) {
140+ if ( ! config . mocked && ! isCheckedLastRunStatus . current && ! isStandAlone ) {
136141 if ( ! config . lastRunExitedNormally ) {
137142 openLastExitedAbnormallyDialog ( ) ;
138143 }
139144 update ( "lastRunExitedNormally" , false ) ;
145+ isCheckedLastRunStatus . current = true ;
140146 }
141147
142148 // update run count, conditionally show some modals.
0 commit comments