From 4b63a5f8374168fe382de8473af50cc0939a7c20 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Thu, 4 May 2023 10:37:32 -0400 Subject: [PATCH] Fix "unfound connection request" error by forcing refresh --- lib/screens/follow_request_adjudication_screen.dart | 8 +++++++- lib/services/follow_requests_manager.dart | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/screens/follow_request_adjudication_screen.dart b/lib/screens/follow_request_adjudication_screen.dart index 40c92f1..006390e 100644 --- a/lib/screens/follow_request_adjudication_screen.dart +++ b/lib/screens/follow_request_adjudication_screen.dart @@ -54,7 +54,13 @@ class _FollowRequestAdjudicationScreenState late final Widget body; if (result.isFailure) { - body = Text('Error getting request info: ${result.error}'); + if (result.error.type == ErrorType.notFound && + nss.connectionUpdateStatus.value) { + fm.update(); + body = const Text('Loading...'); + } else { + body = Text('Error getting request info: ${result.error}'); + } } else { final contact = result.value; final contactStatus = cm diff --git a/lib/services/follow_requests_manager.dart b/lib/services/follow_requests_manager.dart index 6f51854..8483039 100644 --- a/lib/services/follow_requests_manager.dart +++ b/lib/services/follow_requests_manager.dart @@ -28,7 +28,7 @@ class FollowRequestsManager extends ChangeNotifier { return request != null ? Result.ok(request) : buildErrorResult( - type: ErrorType.rangeError, + type: ErrorType.notFound, message: 'Request for $id not found', ); }