Skip to content

Commit 35b0a9f

Browse files
committed
feat(status): enhance new print handling by ensuring readiness before dismissing spinner
1 parent 1b2ea4b commit 35b0a9f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/status/status_screen.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,22 @@ class StatusScreenState extends State<StatusScreen> {
148148

149149
if (_suppressOldStatus ||
150150
provider.isLoading ||
151+
provider.minSpinnerActive ||
151152
status == null ||
152153
thumbnailLoadingForAutoOpen ||
153154
// If this screen was opened as a new print, wait until the
154155
// provider reports the job is ready to display. But allow
155156
// finished/canceled snapshots through so the UI doesn't lock up.
156-
((widget.newPrint && awaiting) &&
157+
// If opened as a new print, wait until provider signals readiness
158+
// (active job + file metadata + thumbnail). Additionally, ensure
159+
// we have at least the file name (or have frozen it) before
160+
// dismissing the global spinner. Some backends report the job
161+
// active before file metadata arrives; keep showing the spinner
162+
// until the UI can display a stable filename.
163+
((widget.newPrint &&
164+
(awaiting ||
165+
((status.printData?.fileData?.name == null) &&
166+
_frozenFileName == null))) &&
157167
!newPrintReady &&
158168
!finishedSnapshot &&
159169
!canceledSnapshot)) {

0 commit comments

Comments
 (0)