From f227725778417d9ef07d4e843017c708ef8a517a Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Sat, 22 Feb 2025 09:54:25 +0100 Subject: [PATCH] Do not show trailing dots for short email subjects (#579) --- .../Main/Components/Email/RecentEmails.razor | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/AliasVault.Client/Main/Components/Email/RecentEmails.razor b/src/AliasVault.Client/Main/Components/Email/RecentEmails.razor index 35cfca3c0..1c59b432a 100644 --- a/src/AliasVault.Client/Main/Components/Email/RecentEmails.razor +++ b/src/AliasVault.Client/Main/Components/Email/RecentEmails.razor @@ -70,7 +70,14 @@ { - @(mail.Subject.Substring(0, mail.Subject.Length > 30 ? 30 : mail.Subject.Length))... + @if (mail.Subject.Length > 30) + { + @(mail.Subject.Substring(0, 30))... + } + else + { + @mail.Subject + } @mail.DateSystem @@ -158,6 +165,7 @@ if (_refreshTimer is not null) { await _cancellationTokenSource.CancelAsync(); + await Task.Delay(100); // Give time for the polling loop to complete _refreshTimer.Dispose(); _refreshTimer = null; } @@ -166,8 +174,11 @@ /// public async ValueTask DisposeAsync() { - await StopPolling(); - _cancellationTokenSource.Dispose(); + if (_refreshTimer is not null) + { + await StopPolling(); + _cancellationTokenSource.Dispose(); + } } ///