Skip to content

Commit

Permalink
Fix period loading (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkamran80 authored Nov 17, 2022
1 parent eadf568 commit 4bb94ee
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 10 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.ndkVersion = '25.0.8775105'
ext.ndkVersion = '25.1.8937393'
repositories {
google()
mavenCentral()
Expand Down
32 changes: 24 additions & 8 deletions lib/utils/schedule.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,30 @@ class Schedule {
}

List<Period> daySchedule(String day) {
if (periodSchedule.containsKey(day) && periods.isNotEmpty) {
return (schedule["schedule"][day] as Map<String, dynamic>).keys.map(
(schedulePeriodName) {
return periods.firstWhere(
(period) => period.originalName == schedulePeriodName,
);
},
).toList();
if (periodSchedule.containsKey(day)) {
final Map<dynamic, dynamic> daySchedule = schedule["schedule"][day];
List<Period> dayPeriods = [];
for (String originalPeriodName in daySchedule.keys) {
final period = daySchedule[originalPeriodName];

PeriodTimes times = period is List
? PeriodTimes(period[0], period[1])
: PeriodTimes(period["times"][0], period["times"][1]);

Period existingPeriod = periods.firstWhere(
(period) => period.originalName == originalPeriodName,
);

dayPeriods.add(
Period(
existingPeriod.name,
originalPeriodName,
times,
existingPeriod.allowEditing,
),
);
}
return dayPeriods;
}

return [];
Expand Down
15 changes: 14 additions & 1 deletion releasenotes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Release Notes

## 1.0.0 (TBD)
## 1.0.1

**Pending release**

- Fix schedule periods bug (periods would be incorrect for that day) (#31)
- Add schedule request form (#25)
- Changed feedback repository issues link to form (#5)
- Add a link to the Discord server (#29)
- Add padding to the bottom of the home and about screens
- Reduce text size for the header on the home screen (#26)

## 1.0.0

**Released to iOS on November 14, Android on November 15, 2022**

- Fix text selection interface (#16)
- Enable notification toggle in settings
Expand Down

0 comments on commit 4bb94ee

Please sign in to comment.