mirror of https://github.com/Devoalda/LaDo.git
parent
1a7f0fe5ed
commit
099344e26c
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace App\Http\Livewire\Pomo;
|
namespace App\Http\Livewire\Pomo;
|
||||||
|
|
||||||
|
use Illuminate\View\View;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
class Timer extends Component
|
class Timer extends Component
|
||||||
|
@ -52,12 +53,18 @@ class Timer extends Component
|
||||||
|
|
||||||
public function mount($time = null): void
|
public function mount($time = null): void
|
||||||
{
|
{
|
||||||
$this->time = $time ?? $this->time;
|
$this->time = session('time') ?? $time ?? $this->time;
|
||||||
|
$this->countdown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function render(): \Illuminate\View\View
|
public function render(): View
|
||||||
{
|
{
|
||||||
|
// Cache time in session
|
||||||
|
session(['time' => $this->time]);
|
||||||
|
$this->time = session('time') ?? $this->time;
|
||||||
|
|
||||||
|
|
||||||
return view('livewire.pomo.timer', [
|
return view('livewire.pomo.timer', [
|
||||||
'time' => $this->time,
|
'time' => $this->time,
|
||||||
'countdown' => $this->countdown,
|
'countdown' => $this->countdown,
|
||||||
|
|
Loading…
Reference in New Issue