Skip to content

Commit

Permalink
Merge pull request #4 from creagia/fixes
Browse files Browse the repository at this point in the history
minor fixes
  • Loading branch information
xmuntane authored Dec 12, 2022
2 parents c8be71a + 964dd95 commit 6fb6eb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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?')) {
Expand Down Expand Up @@ -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) }"
>
<div class="flex">
<div class="flex justify-between">
<div class="text-sm leading-tight" :class="{'font-bold' : !mail.isRead}"
x-text="mail.subject"></div>
<div x-show="mail.hasAttachments">
Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/LaravelWebMailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6fb6eb9

Please sign in to comment.