From e5df28c85d26a3a029764f68462eac86499d9fd2 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 28 Apr 2025 12:48:51 +0530 Subject: [PATCH] to avoid conflicts between two dashboard pages --- app/Filament/Pages/HourlyProduction.php | 6 +++--- app/Filament/Pages/ProductionQuantityPage.php | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Filament/Pages/HourlyProduction.php b/app/Filament/Pages/HourlyProduction.php index 84228d8..b491055 100644 --- a/app/Filament/Pages/HourlyProduction.php +++ b/app/Filament/Pages/HourlyProduction.php @@ -42,9 +42,9 @@ class HourlyProduction extends Page ->reactive() ->afterStateUpdated(function ($state) { session(['selected_plant' => $state]); - - // dd(session('selected_plant')); - $this->triggerChartUpdate(); + // Clear production quantity Dashboard session keys to avoid conflict + session()->forget(['select_plant', 'select_line']); + $this->triggerChartUpdate(); }), // Line Filter diff --git a/app/Filament/Pages/ProductionQuantityPage.php b/app/Filament/Pages/ProductionQuantityPage.php index 4d5a6f0..4503645 100644 --- a/app/Filament/Pages/ProductionQuantityPage.php +++ b/app/Filament/Pages/ProductionQuantityPage.php @@ -124,6 +124,9 @@ class ProductionQuantityPage extends Page implements HasForms $set('block_name', null); session(['select_plant' => $state]); + + session()->forget(['selected_plant', 'selected_line']); + if (!$plantId) { $set('pqPlantError', 'Please select a plant first.'); @@ -278,6 +281,7 @@ class ProductionQuantityPage extends Page implements HasForms session(['select_line' => $state]); + // dd(session('select_line')); $this->triggerChartUpdate();