File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -195,14 +195,21 @@ extension AppDelegate {
195195 // Keep trying to close the welcome window until a main window is visible.
196196 // DuckDB and other slow-connecting databases may take several seconds,
197197 // so we poll repeatedly rather than giving up after 700ms.
198+ var suppressed = false
198199 for attempt in 0 ..< 30 {
199200 try ? await Task . sleep ( for: . milliseconds( attempt < 4 ? 200 : 500 ) )
200201 guard let self else { return }
201202 if self . closeWelcomeWindowIfMainExists ( ) {
203+ suppressed = true
202204 break
203205 }
204206 }
205207 guard let self else { return }
208+ if !suppressed {
209+ // Timed out — restore welcome window so the app isn't left windowless
210+ windowLogger. warning ( " Welcome window suppression timed out after 15s, restoring welcome window " )
211+ self . openWelcomeWindow ( )
212+ }
206213 self . fileOpenSuppressionCount = max ( 0 , self . fileOpenSuppressionCount - 1 )
207214 if self . fileOpenSuppressionCount == 0 {
208215 self . isHandlingFileOpen = false
You can’t perform that action at this time.
0 commit comments