Skip to content

Commit

Permalink
Merge pull request #1448 from hydephp/dashboard-internals-cleanup
Browse files Browse the repository at this point in the history
Minor dashboard internals cleanup
  • Loading branch information
caendesilva authored Nov 11, 2023
2 parents cd9add2 + 4acd0f1 commit d325a10
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/realtime-compiler/src/Http/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ class DashboardController

protected Request $request;
protected ConsoleOutput $console;
protected bool $isAsync = false;
protected JsonResponse $response;

protected bool $isAsync = false;
protected array $flashes = [];

protected static array $tips = [
Expand All @@ -51,8 +52,6 @@ class DashboardController
'The dashboard update your project files. You can disable this by setting `server.dashboard.interactive` to `false` in `config/hyde.php`.',
];

protected JsonResponse $response;

public function __construct()
{
$this->title = config('hyde.name').' - Dashboard';
Expand All @@ -62,7 +61,7 @@ public function __construct()
$this->loadFlashData();

if ($this->request->method === 'POST') {
$this->isAsync = (getallheaders()['X-RC-Handler'] ?? getallheaders()['x-rc-handler'] ?? null) === 'Async';
$this->isAsync = $this->hasAsyncHeaders();
}
}

Expand Down Expand Up @@ -506,4 +505,9 @@ protected function matchStatusCode(int $statusCode): string
default => 'Internal Server Error',
};
}

protected function hasAsyncHeaders(): bool
{
return (getallheaders()['X-RC-Handler'] ?? getallheaders()['x-rc-handler'] ?? null) === 'Async';
}
}

0 comments on commit d325a10

Please sign in to comment.