diff --git a/lib/barcode/controller.dart b/lib/barcode/controller.dart index 7a1fb1f8..f1c3789b 100644 --- a/lib/barcode/controller.dart +++ b/lib/barcode/controller.dart @@ -59,12 +59,6 @@ class InvenTreeBarcodeControllerState extends State processingBarcode = true; }); - BuildContext? context; - - if (hasContext()) { - context = OneContext.hasContext ? OneContext().context : null; - } - showLoadingOverlay(); await pauseScan(); diff --git a/lib/widget/progress.dart b/lib/widget/progress.dart index 618941b3..a2a296d7 100644 --- a/lib/widget/progress.dart +++ b/lib/widget/progress.dart @@ -45,7 +45,7 @@ Widget progressIndicator() { void showLoadingOverlay() { - BuildContext? context = OneContext().context; + BuildContext? context = OneContext.hasContext ? OneContext().context : null; if (context == null) { return;