feat: adopt smolmail protocol 1.1, adaptive nav shell, and server mail retention
This commit is contained in:
parent
eaaa3f2ede
commit
c693e6fcb9
27 changed files with 1190 additions and 592 deletions
|
|
@ -11,13 +11,13 @@ import "package:smol_mail/smol/proto.dart";
|
|||
import "package:smol_mail/smol/store.dart";
|
||||
|
||||
class MessageTile extends ConsumerWidget {
|
||||
final String folder;
|
||||
final MailRecord record;
|
||||
|
||||
const MessageTile({super.key, required this.record});
|
||||
const MessageTile({super.key, required this.folder, required this.record});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final folder = ref.watch(folderProvider);
|
||||
final store = ref.watch(storeProvider);
|
||||
final opened = ref.read(clientProvider).describe(record);
|
||||
final appColors = Theme.of(context).extension<AppColors>()!;
|
||||
|
|
@ -31,7 +31,7 @@ class MessageTile extends ConsumerWidget {
|
|||
} else {
|
||||
who = "?";
|
||||
}
|
||||
final unread = folder == "inbox" && !store.isRead(record.id);
|
||||
final unread = folder != "sent" && !store.isRead(record.id);
|
||||
final errorText = opened.error != null ? "<unreadable>" : null;
|
||||
final subject =
|
||||
errorText ?? (opened.subject.isEmpty ? "(no subject)" : opened.subject);
|
||||
|
|
@ -44,7 +44,7 @@ class MessageTile extends ConsumerWidget {
|
|||
splashColor: appColors.highlight,
|
||||
focusColor: appColors.cardFill,
|
||||
onTap: () {
|
||||
if (folder == "inbox") {
|
||||
if (folder != "sent") {
|
||||
store.markRead(record.id);
|
||||
ref.read(revisionProvider.notifier).bump();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue