From 3171541b6afd0653de9719436e8a8038d972c1e5 Mon Sep 17 00:00:00 2001 From: otsmr Date: Wed, 29 Jul 2026 16:33:30 +0200 Subject: [PATCH] fix issue with opening media --- CHANGELOG.md | 1 + .../camera_preview_controller_view.dart | 13 +------------ .../visual/views/chats/media_viewer.view.dart | 19 ------------------- pubspec.yaml | 2 +- 4 files changed, 3 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b14c904..809a21b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## 0.4.3 - New: Contact labels +- Fix: Multiple black screens ## 0.4.0 diff --git a/lib/src/visual/views/camera/camera_preview_components/camera_preview_controller_view.dart b/lib/src/visual/views/camera/camera_preview_components/camera_preview_controller_view.dart index 4dad7fc0..7860eb78 100644 --- a/lib/src/visual/views/camera/camera_preview_components/camera_preview_controller_view.dart +++ b/lib/src/visual/views/camera/camera_preview_components/camera_preview_controller_view.dart @@ -706,18 +706,7 @@ class _CameraPreviewViewState extends State { _checkAndInitCamera(); }); } - // Show a loader instead of an empty container to prevent a black screen - // while the camera is initializing or if initialization failed. - return Center( - child: SizedBox( - height: 60, - width: 60, - child: ThreeRotatingDots( - size: 40, - color: context.color.primary, - ), - ), - ); + return Container(); } return StreamBuilder( stream: userService.onUserUpdated, diff --git a/lib/src/visual/views/chats/media_viewer.view.dart b/lib/src/visual/views/chats/media_viewer.view.dart index c46bfb35..5cc36dda 100644 --- a/lib/src/visual/views/chats/media_viewer.view.dart +++ b/lib/src/visual/views/chats/media_viewer.view.dart @@ -671,25 +671,6 @@ class _MediaViewerViewState extends State { child: Stack( fit: StackFit.expand, children: [ - // Fallback: when no content is visible (no media, no loader, - // no twonly-present overlay), show a loader to prevent a - // black screen. If there are truly no files left, exit. - if (!_showDownloadingLoader && - currentMedia == null && - videoController == null && - !displayTwonlyPresent) - Builder(builder: (context) { - // Schedule exit on the next frame if there is nothing - // left to display, so we don't trap the user. - if (allMediaFiles.isEmpty) { - WidgetsBinding.instance.addPostFrameCallback((_) { - if (mounted && currentMedia == null) { - Navigator.of(context).maybePop(); - } - }); - } - return _loader(); - }), if (_showDownloadingLoader) _loader(), if ((currentMedia != null || videoController != null) && (canBeSeenUntil == null || progress.value >= 0)) diff --git a/pubspec.yaml b/pubspec.yaml index ac8b72ec..3ab160ed 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec publish_to: 'none' -version: 0.4.3+162 +version: 0.4.3+163 environment: sdk: ^3.11.0