Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Minor fixes

Neeraj Gupta00530d4ce770
diff --git a/mobile/apps/photos/lib/ui/payment/stripe_subscription_page.dart b/mobile/apps/photos/lib/ui/payment/stripe_subscription_page.dart
index 9f2d606d50..a76f414d81 100644
--- a/mobile/apps/photos/lib/ui/payment/stripe_subscription_page.dart
+++ b/mobile/apps/photos/lib/ui/payment/stripe_subscription_page.dart
@@ -98,7 +98,9 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
final isYearlyPlan = plan.period == 'year';
return isYearlyPlan == _showYearlyPlan;
}).toList();
- setState(() {});
+ if (mounted) {
+ setState(() {});
+ }
}
FutureOr onWebPaymentGoBack(dynamic value) async {
diff --git a/mobile/apps/photos/lib/ui/tabs/home_widget.dart b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
index fe872ad76b..38d382896e 100644
--- a/mobile/apps/photos/lib/ui/tabs/home_widget.dart
+++ b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
@@ -878,10 +878,10 @@ class _HomeWidgetState extends State<HomeWidget> {
}
void _getCredentials(BuildContext context, Uri? link) {
- if (Configuration.instance.hasConfiguredAccount()) {
+ if (Configuration.instance.hasConfiguredAccount() || link == null) {
return;
}
- final ott = link!.queryParameters["ott"]!;
+ final ott = link.queryParameters["ott"]!;
UserService.instance.verifyEmail(context, ott);
}
diff --git a/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart b/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart
index 4d965cb744..3e52a36791 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/video_widget_native.dart
@@ -480,7 +480,9 @@ class _VideoWidgetNativeState extends State<VideoWidgetNative>
break;
case PlaybackPositionChangedEvent():
position = event.positionInMilliseconds;
- setState(() {});
+ if (mounted) {
+ setState(() {});
+ }
break;
case PlaybackEndedEvent():
_onPlaybackEnded();
diff --git a/mobile/apps/photos/lib/ui/viewer/people/person_cluster_suggestion.dart b/mobile/apps/photos/lib/ui/viewer/people/person_cluster_suggestion.dart
index 527405d4d9..781a41b105 100644
--- a/mobile/apps/photos/lib/ui/viewer/people/person_cluster_suggestion.dart
+++ b/mobile/apps/photos/lib/ui/viewer/people/person_cluster_suggestion.dart
@@ -55,7 +55,7 @@ class _PersonClustersState extends State<PersonReviewClusterSuggestion> {
// Declare a variable for the future
late Future<List<ClusterSuggestion>> futureClusterSuggestions;
- late StreamSubscription<PeopleChangedEvent> _peopleChangedEvent;
+ StreamSubscription<PeopleChangedEvent>? _peopleChangedEvent;
@override
void initState() {
@@ -66,7 +66,7 @@ class _PersonClustersState extends State<PersonReviewClusterSuggestion> {
@override
void dispose() {
- _peopleChangedEvent.cancel();
+ _peopleChangedEvent?.cancel();
super.dispose();
}
@@ -101,6 +101,8 @@ class _PersonClustersState extends State<PersonReviewClusterSuggestion> {
builder: (context, snapshot) {
if (snapshot.hasData) {
if (snapshot.data!.isEmpty) {
+ _peopleChangedEvent?.cancel();
+ _peopleChangedEvent = null;
return Center(
child: Text(
AppLocalizations.of(context).noSuggestionsForPerson(
@@ -125,6 +127,7 @@ class _PersonClustersState extends State<PersonReviewClusterSuggestion> {
clusterID,
);
+ _peopleChangedEvent?.cancel();
_peopleChangedEvent =
Bus.instance.on<PeopleChangedEvent>().listen((event) {
if (event.source == clusterID.toString()) {