From 520d854e689ed8670b286745aec55bd24e9e2c6b Mon Sep 17 00:00:00 2001 From: Krille Date: Mon, 24 Jun 2024 13:46:41 +0200 Subject: [PATCH 1/3] build: Update matrix dart sdk --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7d4febdb2..878f03c87 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -64,7 +64,7 @@ dependencies: keyboard_shortcuts: ^0.1.4 latlong2: ^0.9.1 linkify: ^5.0.0 - matrix: ^0.29.12 + matrix: ^0.29.13 native_imaging: ^0.1.1 package_info_plus: ^6.0.0 pasteboard: ^0.2.0 From cdd32e7002926cd59f4980c33d56eee4274af8bd Mon Sep 17 00:00:00 2001 From: Krille Date: Wed, 26 Jun 2024 14:46:51 +0200 Subject: [PATCH 2/3] chore: Update last event after decryption --- lib/pages/chat_list/chat_list_item.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pages/chat_list/chat_list_item.dart b/lib/pages/chat_list/chat_list_item.dart index 965c73917..4ac02e62b 100644 --- a/lib/pages/chat_list/chat_list_item.dart +++ b/lib/pages/chat_list/chat_list_item.dart @@ -232,7 +232,9 @@ class ChatListItem extends StatelessWidget { softWrap: false, ) : FutureBuilder( - key: ValueKey(lastEvent?.eventId), + key: ValueKey( + '${lastEvent?.eventId}_${lastEvent?.type}', + ), future: needLastEventSender ? lastEvent.calcLocalizedBody( MatrixLocals(L10n.of(context)!), From 2b630aca4d1a2d67b3796c50cc8ce0067eb9eef8 Mon Sep 17 00:00:00 2001 From: Krille Date: Thu, 27 Jun 2024 15:26:56 +0200 Subject: [PATCH 3/3] fix: Correctly localize time of date --- lib/utils/date_time_extension.dart | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/utils/date_time_extension.dart b/lib/utils/date_time_extension.dart index 121eaf72e..f546f9a5a 100644 --- a/lib/utils/date_time_extension.dart +++ b/lib/utils/date_time_extension.dart @@ -34,14 +34,8 @@ extension DateTimeExtension on DateTime { } /// Returns a simple time String. - /// TODO: Add localization - String localizedTimeOfDay(BuildContext context) { - if (MediaQuery.of(context).alwaysUse24HourFormat) { - return '${_z(hour)}:${_z(minute)}'; - } else { - return '${_z(hour % 12 == 0 ? 12 : hour % 12)}:${_z(minute)} ${hour > 11 ? "pm" : "am"}'; - } - } + String localizedTimeOfDay(BuildContext context) => + DateFormat.Hm(L10n.of(context)!.localeName).format(this); /// Returns [localizedTimeOfDay()] if the ChatTime is today, the name of the week /// day if the ChatTime is this week and a date string else. @@ -91,6 +85,4 @@ extension DateTimeExtension on DateTime { localizedTimeOfDay(context), ); } - - static String _z(int i) => i < 10 ? '0${i.toString()}' : i.toString(); }