Partial Busy state for mark as read requests
This commit is contained in:
@@ -724,7 +724,7 @@ public class WinoMailCollection : ObservableRecipient, IRecipient<SelectedItemsC
|
||||
/// </summary>
|
||||
/// <param name="updatedMailCopy">Updated mail copy.</param>
|
||||
/// <returns></returns>
|
||||
public Task UpdateMailCopy(MailCopy updatedMailCopy)
|
||||
public Task UpdateMailCopy(MailCopy updatedMailCopy, MailUpdateSource mailUpdateSource)
|
||||
{
|
||||
// This item doesn't exist in the list.
|
||||
if (!MailCopyIdHashSet.ContainsKey(updatedMailCopy.UniqueId)) return Task.CompletedTask;
|
||||
@@ -743,14 +743,14 @@ public class WinoMailCollection : ObservableRecipient, IRecipient<SelectedItemsC
|
||||
// This maintains reference integrity and ensures PropertyChanged is raised for all properties
|
||||
itemContainer.ItemViewModel.UpdateFrom(updatedMailCopy);
|
||||
|
||||
// Mark the item view model as busy until the network operation is completed.
|
||||
itemContainer.ItemViewModel.IsBusy = mailUpdateSource == MailUpdateSource.ClientUpdated;
|
||||
|
||||
UpdateUniqueIdHashes(itemContainer.ItemViewModel, true);
|
||||
}
|
||||
|
||||
// Trigger thread property notifications if this item is in a thread
|
||||
if (itemContainer.ThreadViewModel != null)
|
||||
{
|
||||
itemContainer.ThreadViewModel.NotifyMailItemUpdated(itemContainer.ItemViewModel);
|
||||
}
|
||||
itemContainer.ThreadViewModel?.NotifyMailItemUpdated(itemContainer.ItemViewModel);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,13 @@ public partial class MailItemViewModel(MailCopy mailCopy) : ObservableRecipient,
|
||||
[NotifyPropertyChangedRecipients]
|
||||
public partial bool IsSelected { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if this mail item is currently being processed by a network operation.
|
||||
/// Used to show loading state in the UI.
|
||||
/// </summary>
|
||||
[ObservableProperty]
|
||||
public partial bool IsBusy { get; set; }
|
||||
|
||||
public DateTime CreationDate
|
||||
{
|
||||
get => MailCopy.CreationDate;
|
||||
|
||||
@@ -25,6 +25,9 @@ public partial class ThreadMailItemViewModel : ObservableRecipient, IMailListIte
|
||||
[NotifyPropertyChangedFor(nameof(IsSelectedOrExpanded))]
|
||||
public partial bool IsSelected { get; set; }
|
||||
|
||||
[ObservableProperty]
|
||||
public partial bool IsBusy { get; set; }
|
||||
|
||||
public bool IsSelectedOrExpanded => IsSelected || IsThreadExpanded;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -668,7 +668,7 @@ public partial class MailListPageViewModel : MailBaseViewModel,
|
||||
{
|
||||
base.OnMailUpdated(updatedMail, source);
|
||||
|
||||
await MailCollection.UpdateMailCopy(updatedMail);
|
||||
await MailCollection.UpdateMailCopy(updatedMail, source);
|
||||
|
||||
await ExecuteUIThread(() => { SetupTopBarActions(); });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user