From 6c3b83c05bc8e7fe654c850c33f7be91134226d6 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 26 Mar 2022 17:40:02 +1100 Subject: [PATCH] Same thing, but for the "part" display --- lib/widget/part_detail.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/widget/part_detail.dart b/lib/widget/part_detail.dart index 3357e71e..40c5ce4a 100644 --- a/lib/widget/part_detail.dart +++ b/lib/widget/part_detail.dart @@ -86,7 +86,14 @@ class _PartDisplayState extends RefreshableState { @override Future request(BuildContext context) async { - await part.reload(); + + final bool result = await part.reload(); + + if (!result || part.pk == -1) { + // Part could not be loaded, for some reason + Navigator.of(context).pop(); + } + await part.getTestTemplates(); }