[mob][photos] Regression dumb fix

This commit is contained in:
laurenspriem 2024-05-14 19:45:55 +05:30
parent df1ca5d583
commit 48e78d170d
4 changed files with 21 additions and 7 deletions

View file

@ -184,7 +184,12 @@ class _ClusterPageState extends State<ClusterPage> {
context,
clusterID: widget.clusterID,
);
if (result != null && result is PersonEntity) {
if (result != null &&
result is (PersonEntity, EnteFile)) {
Navigator.pop(context);
// ignore: unawaited_futures
routeToPage(context, PeoplePage(person: result.$1));
} else if (result != null && result is PersonEntity) {
Navigator.pop(context);
// ignore: unawaited_futures
routeToPage(context, PeoplePage(person: result));

View file

@ -9,6 +9,7 @@ import "package:photos/events/people_changed_event.dart";
import 'package:photos/events/subscription_purchased_event.dart';
import "package:photos/face/model/person.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/models/file/file.dart";
import 'package:photos/models/gallery_type.dart';
import 'package:photos/models/selected_files.dart';
import 'package:photos/services/collections_service.dart';
@ -314,7 +315,10 @@ class _AppBarWidgetState extends State<PeopleAppBar> {
clusterID: widget.person.data.assigned!.first.id,
);
Navigator.pop(context);
if (result != null && result is PersonEntity) {
if (result != null && result is (PersonEntity, EnteFile)) {
// ignore: unawaited_futures
routeToPage(context, PeoplePage(person: result.$1));
} else if (result != null && result is PersonEntity) {
// ignore: unawaited_futures
routeToPage(context, PeoplePage(person: result));
}

View file

@ -303,10 +303,11 @@ class _PersonClustersState extends State<PersonReviewClusterSuggestion> {
context,
clusterID: clusterID,
);
if (result == null || result is! PersonEntity) {
return;
if (result != null &&
(result is (PersonEntity, EnteFile) ||
result is PersonEntity)) {
await _rejectSuggestion(clusterID, numberOfSuggestions);
}
await _rejectSuggestion(clusterID, numberOfSuggestions);
},
),
],

View file

@ -5,6 +5,7 @@ import "package:flutter/material.dart";
import "package:photos/core/constants.dart";
import "package:photos/events/event.dart";
import "package:photos/face/model/person.dart";
import "package:photos/models/file/file.dart";
import "package:photos/models/search/album_search_result.dart";
import "package:photos/models/search/generic_search_result.dart";
import "package:photos/models/search/recent_searches.dart";
@ -265,8 +266,11 @@ class SearchExample extends StatelessWidget {
context,
clusterID: int.parse(searchResult.name()),
);
if (result != null && result is PersonEntity) {
// Navigator.pop(context);
if (result != null &&
result is (PersonEntity, EnteFile)) {
// ignore: unawaited_futures
routeToPage(context, PeoplePage(person: result.$1));
} else if (result != null && result is PersonEntity) {
// ignore: unawaited_futures
routeToPage(context, PeoplePage(person: result));
}