1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 08:31:59 +00:00

Fixed mobile timeline crash when date group cannot be parsed (#530)

* Handle error when datetime is incorrect

* Added better debug message
This commit is contained in:
Alex 2022-08-24 21:31:20 -07:00 committed by GitHub
parent db2ed2d881
commit bf2760ffef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,6 +65,7 @@ class HomePage extends HookConsumerWidget {
int? lastMonth;
assetGroupByDateTime.forEach((dateGroup, immichAssetList) {
try {
DateTime parseDateGroup = DateTime.parse(dateGroup);
int currentMonth = parseDateGroup.month;
@ -90,12 +91,19 @@ class HomePage extends HookConsumerWidget {
ImageGrid(
assetGroup: immichAssetList,
sortedAssetGroup: sortedAssetList,
tilesPerRow: appSettingService.getSetting(AppSettingsEnum.tilesPerRow),
showStorageIndicator: appSettingService.getSetting(AppSettingsEnum.storageIndicator),
tilesPerRow:
appSettingService.getSetting(AppSettingsEnum.tilesPerRow),
showStorageIndicator: appSettingService
.getSetting(AppSettingsEnum.storageIndicator),
),
);
lastMonth = currentMonth;
} catch (e) {
debugPrint(
"[ERROR] Cannot parse $dateGroup - Wrong create date format : ${immichAssetList.map((asset) => asset.createdAt).toList()}",
);
}
});
}