feat(diary): fexed wrong day selecting logic

This commit is contained in:
misha
2025-10-06 13:33:12 +03:00
parent 5ee86ddc92
commit f35cdd26a3

View File

@@ -49,10 +49,14 @@ class DiaryCubit extends Cubit<DiaryState> {
String comment = '';
Future<bool> setSelectedDay(DateTime day) async {
final prevDay = selectedDay;
selectedDay = day;
final canSelect = await fetchDiaryV2(needLoading: true);
if (canSelect) {
selectedDay = day;
if (!canSelect) {
selectedDay = prevDay;
}
return canSelect;
}