diff --git a/lib/src/screens/home_screen.dart b/lib/src/screens/home_screen.dart index 5ac9015..3be8e19 100644 --- a/lib/src/screens/home_screen.dart +++ b/lib/src/screens/home_screen.dart @@ -228,7 +228,6 @@ class _HomeScreenState extends State { } prefs.remove('pairingKey'); - _resetState(); } catch (error) { ScaffoldMessenger.of(context).showSnackBar( @@ -236,6 +235,10 @@ class _HomeScreenState extends State { content: Text(error.toString()), ), ); + + final prefs = await SharedPreferences.getInstance(); + prefs.remove('pairingKey'); + _resetState(); } }