Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor dashboard internals cleanup #1448

Merged
merged 3 commits into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
}
}
Loading