diff --git a/lib/dashbot/dashbot_dashboard.dart b/lib/dashbot/dashbot_dashboard.dart index 5f005cdd..276512ee 100644 --- a/lib/dashbot/dashbot_dashboard.dart +++ b/lib/dashbot/dashbot_dashboard.dart @@ -144,10 +144,6 @@ class DashbotWindow extends ConsumerWidget { .read(dashbotWindowNotifierProvider .notifier) .togglePopped(); - ref - .read(dashbotWindowNotifierProvider - .notifier) - .toggleActive(); }, ), IconButton( diff --git a/lib/dashbot/dashbot_tab.dart b/lib/dashbot/dashbot_tab.dart index bdd8c908..d112ffd5 100644 --- a/lib/dashbot/dashbot_tab.dart +++ b/lib/dashbot/dashbot_tab.dart @@ -87,10 +87,6 @@ class _DashbotTabState extends ConsumerState .read(dashbotWindowNotifierProvider.notifier) .togglePopped(); - ref - .read(dashbotWindowNotifierProvider.notifier) - .toggleActive(); - final newState = ref.read(dashbotWindowNotifierProvider); if (newState.isPopped) { diff --git a/lib/dashbot/features/home/view/pages/home_page.dart b/lib/dashbot/features/home/view/pages/home_page.dart index 243d0bc6..bcd9ebec 100644 --- a/lib/dashbot/features/home/view/pages/home_page.dart +++ b/lib/dashbot/features/home/view/pages/home_page.dart @@ -23,20 +23,6 @@ class DashbotHomePage extends ConsumerStatefulWidget { class _DashbotHomePageState extends ConsumerState { @override Widget build(BuildContext context) { - // final hasOkResponse = ref.watch( - // selectedRequestModelProvider.select((req) => - // req?.httpResponseModel?.statusCode != null && - // req?.httpResponseModel?.statusCode == 200), - // ); - - // ref.listen( - // selectedRequestModelProvider, - // (current, next) { - // if (current?.id != next?.id) { - // Navigator.pop(context); - // } - // }, - // ); return Container( padding: const EdgeInsets.all(16), child: Column( diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart index 6c612821..2f2a9769 100644 --- a/lib/screens/dashboard.dart +++ b/lib/screens/dashboard.dart @@ -21,6 +21,8 @@ class Dashboard extends ConsumerWidget { ref.watch(settingsProvider.select((value) => value.isDashBotEnabled)); final isDashBotActive = ref .watch(dashbotWindowNotifierProvider.select((value) => value.isActive)); + final isDashBotPopped = ref + .watch(dashbotWindowNotifierProvider.select((value) => value.isPopped)); return Scaffold( body: SafeArea( child: Row( @@ -129,7 +131,9 @@ class Dashboard extends ConsumerWidget { ], ), ), - floatingActionButton: isDashBotEnabled && !isDashBotActive + floatingActionButton: isDashBotEnabled && + !isDashBotActive && + isDashBotPopped ? FloatingActionButton( backgroundColor: Theme.of(context).colorScheme.primaryContainer, onPressed: () => showDashbotWindow(context, ref),