fix(application-source): support localhost key with id=0

Previously, the view checked $privateKeyId with ! operator, which
incorrectly treats 0 (localhost key) as falsy. Changed to explicit
is_null() checks to distinguish between null (no key) and 0 (localhost).
Added test coverage for both cases.
This commit is contained in:
Andras Bacsai committed 2026-03-09 17:20:33 +01:00
1 parent 11007771f0
commit 01aa534556
4 files changed
+67 -8

No files matched your search

@@ -28,7 +28,7 @@
<div class="pb-4">Code source of your application.</div>
<div class="flex flex-col gap-2">
@if (!$privateKeyId)
@if (is_null($privateKeyId))
<div>Currently connected source: <span
class="font-bold text-warning">{{ data_get($application, 'source.name', 'No source connected') }}</span>
</div>
@@ -44,7 +44,7 @@
</div>
</div>
@if ($privateKeyId)
@if (!is_null($privateKeyId))
<h3 class="pt-4">Deploy Key</h3>
<div class="py-2 pt-4">Currently attached Private Key: <span
class="dark:text-warning">{{ $privateKeyName }}</span>