Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Fix state issue with video loop toggle button

ashilknc6ec5cf64546
diff --git a/mobile/lib/ui/viewer/file/file_app_bar.dart b/mobile/lib/ui/viewer/file/file_app_bar.dart
index 92d6d54239..b65a9d9c1e 100644
--- a/mobile/lib/ui/viewer/file/file_app_bar.dart
+++ b/mobile/lib/ui/viewer/file/file_app_bar.dart
@@ -57,6 +57,7 @@ class FileAppBarState extends State<FileAppBar> {
late final StreamSubscription<GuestViewEvent> _guestViewEventSubscription;
bool isGuestView = false;
bool shouldLoopVideo = Configuration.instance.shouldLoopVideo();
+ bool _reloadActions = false;
@override
void didUpdateWidget(FileAppBar oldWidget) {
@@ -89,8 +90,9 @@ class FileAppBarState extends State<FileAppBar> {
//When the widget is initialized, the actions are not available.
//Cannot call _getActions() in initState.
- if (_actions.isEmpty) {
+ if (_actions.isEmpty || _reloadActions) {
_getActions();
+ _reloadActions = false;
}
final isTrashedFile = widget.file is TrashFile;
@@ -372,6 +374,7 @@ class FileAppBarState extends State<FileAppBar> {
_onToggleVideoLoop() {
Configuration.instance.setShouldLoopVideo(!shouldLoopVideo);
setState(() {
+ _reloadActions = true;
shouldLoopVideo = !shouldLoopVideo;
});
}