diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index 6833591..bcff769 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -53,6 +53,9 @@ }, async retrieveMails() { this.mails = await (await fetch("{{ route('laravelWebMailer.fetchAll') }}")).json(); + if (this.mails.length === 0) { + this.currentMail = false; + } }, async confirmAndDeleteAllMails() { if (!confirm('Are you sure you want to delete all emails?')) { @@ -130,7 +133,7 @@ class="flex items-center text-sm rounded-full border-2 border-neutral-700 px-3 p @click="showMail(index)" :class="{'bg-neutral-100' : mail.isRead, 'border-x-blue-500' : (mail.messageId===currentMail.messageId), 'border-x-transparent' : (mail.messageId!==currentMail.messageId) }" > -
+
diff --git a/src/Controllers/LaravelWebMailController.php b/src/Controllers/LaravelWebMailController.php index be3b5ab..281351d 100644 --- a/src/Controllers/LaravelWebMailController.php +++ b/src/Controllers/LaravelWebMailController.php @@ -59,7 +59,7 @@ public function fetch(string $messageId): JsonResponse ->toArray(); return response()->json((object)[ - 'sentAtFormatted' => $laravelWebMailDto->sentAt->format('Y-m-d H:m'), + 'sentAtFormatted' => $laravelWebMailDto->sentAt->format('Y-m-d H:i'), 'eml' => $this->laravelWebMailRepository->findEml($messageId), 'attachments' => $attachments, 'messageId' => $laravelWebMailDto->messageId,