mirror of
https://github.com/immich-app/immich.git
synced 2025-02-11 01:18:24 -05: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:
parent
db2ed2d881
commit
bf2760ffef
1 changed files with 36 additions and 28 deletions
|
@ -65,6 +65,7 @@ class HomePage extends HookConsumerWidget {
|
||||||
int? lastMonth;
|
int? lastMonth;
|
||||||
|
|
||||||
assetGroupByDateTime.forEach((dateGroup, immichAssetList) {
|
assetGroupByDateTime.forEach((dateGroup, immichAssetList) {
|
||||||
|
try {
|
||||||
DateTime parseDateGroup = DateTime.parse(dateGroup);
|
DateTime parseDateGroup = DateTime.parse(dateGroup);
|
||||||
int currentMonth = parseDateGroup.month;
|
int currentMonth = parseDateGroup.month;
|
||||||
|
|
||||||
|
@ -90,12 +91,19 @@ class HomePage extends HookConsumerWidget {
|
||||||
ImageGrid(
|
ImageGrid(
|
||||||
assetGroup: immichAssetList,
|
assetGroup: immichAssetList,
|
||||||
sortedAssetGroup: sortedAssetList,
|
sortedAssetGroup: sortedAssetList,
|
||||||
tilesPerRow: appSettingService.getSetting(AppSettingsEnum.tilesPerRow),
|
tilesPerRow:
|
||||||
showStorageIndicator: appSettingService.getSetting(AppSettingsEnum.storageIndicator),
|
appSettingService.getSetting(AppSettingsEnum.tilesPerRow),
|
||||||
|
showStorageIndicator: appSettingService
|
||||||
|
.getSetting(AppSettingsEnum.storageIndicator),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
lastMonth = currentMonth;
|
lastMonth = currentMonth;
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint(
|
||||||
|
"[ERROR] Cannot parse $dateGroup - Wrong create date format : ${immichAssetList.map((asset) => asset.createdAt).toList()}",
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue