mirror of
https://gitlab.com/mysocialportal/relatica
synced 2024-10-18 15:53:32 +00:00
Fix interactions browser able to go to profiles never seen before
This commit is contained in:
parent
0beac5b2c7
commit
b9afe6f823
2 changed files with 20 additions and 4 deletions
|
@ -11,6 +11,7 @@ import '../models/connection.dart';
|
||||||
import '../models/exec_error.dart';
|
import '../models/exec_error.dart';
|
||||||
import '../models/interaction_type_enum.dart';
|
import '../models/interaction_type_enum.dart';
|
||||||
import '../routes.dart';
|
import '../routes.dart';
|
||||||
|
import '../services/connections_manager.dart';
|
||||||
import '../services/interactions_manager.dart';
|
import '../services/interactions_manager.dart';
|
||||||
import '../services/network_status_service.dart';
|
import '../services/network_status_service.dart';
|
||||||
import '../utils/active_profile_selector.dart';
|
import '../utils/active_profile_selector.dart';
|
||||||
|
@ -66,9 +67,19 @@ class InteractionsViewerScreen extends StatelessWidget {
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final connection = connections[index];
|
final connection = connections[index];
|
||||||
return ListTile(
|
return ListTile(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
context.pushNamed(ScreenPaths.userProfile,
|
await getIt<ActiveProfileSelector<ConnectionsManager>>()
|
||||||
params: {'id': connection.id});
|
.activeEntry
|
||||||
|
.andThenSuccessAsync((cm) async {
|
||||||
|
final existingData = cm.getById(connection.id);
|
||||||
|
if (existingData.isFailure) {
|
||||||
|
await cm.fullRefresh(connection);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (context.mounted) {
|
||||||
|
context.pushNamed(ScreenPaths.userProfile,
|
||||||
|
params: {'id': connection.id});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
leading: ImageControl(
|
leading: ImageControl(
|
||||||
imageUrl: connection.avatarUrl.toString(),
|
imageUrl: connection.avatarUrl.toString(),
|
||||||
|
|
|
@ -303,7 +303,12 @@ class _SearchScreenState extends State<SearchScreen> {
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await getIt<ActiveProfileSelector<ConnectionsManager>>()
|
await getIt<ActiveProfileSelector<ConnectionsManager>>()
|
||||||
.activeEntry
|
.activeEntry
|
||||||
.andThenSuccessAsync((cm) async => cm.fullRefresh(connection));
|
.andThenSuccessAsync((cm) async {
|
||||||
|
final existingData = cm.getById(connection.id);
|
||||||
|
if (existingData.isFailure) {
|
||||||
|
await cm.fullRefresh(connection);
|
||||||
|
}
|
||||||
|
});
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.pushNamed(ScreenPaths.userProfile,
|
context.pushNamed(ScreenPaths.userProfile,
|
||||||
params: {'id': connection.id});
|
params: {'id': connection.id});
|
||||||
|
|
Loading…
Reference in a new issue