Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
jevonmao committed Dec 25, 2022
1 parent 18bc2f0 commit 8558f3f
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ struct ScheduleDetailView: View {
//1st or 2nd lunch revolving periods, 2nd out of 3 UI sections
var lunchPeriods: LunchBlock? {
let periods = scheduleDay?.periods ?? []
let firstIndex = scheduleDay?.periods?.firstIndex{$0.periodCategory.isLunchRevolving}
let lastIndex = scheduleDay?.periods?.lastIndex{$0.periodCategory.isLunchRevolving} //Last instance 1st/2nd nutrition block
let firstIndex = scheduleDay?.periods.firstIndex{$0.periodCategory.isLunchRevolving}
let lastIndex = scheduleDay?.periods.lastIndex{$0.periodCategory.isLunchRevolving} //Last instance 1st/2nd nutrition block
if let firstIndex = firstIndex,
let lastIndex = lastIndex {
let lunchPeriods = Array(periods[firstIndex...lastIndex])
Expand All @@ -66,20 +66,17 @@ struct ScheduleDetailView: View {

//Periods after lunch, 3rd out of 3 UI sections
var postLunchPeriods: [ClassPeriod] {
let lastIndex = scheduleDay?.periods?.lastIndex{$0.periodCategory.isLunchRevolving}
if let lastIndex = lastIndex,
let scheduleDay = scheduleDay,
let removingPeriod8 = scheduleDay.periods?.filter({$0.periodNumber != 8})
{

let lastIndex = scheduleDay?.periods.lastIndex{$0.periodCategory.isLunchRevolving}
if let lastIndex = lastIndex, let scheduleDay = scheduleDay {
let removingPeriod8 = scheduleDay.periods.filter {$0.periodNumber != 8}
//lastIndex + 1 to shorten array, remove unwanted
return Array(removingPeriod8.suffix(from: lastIndex + 1))
}
return []
}

var period8: ClassPeriod? {
scheduleDay?.periods?.filter {$0.periodNumber == 8}.first
scheduleDay?.periods.filter {$0.periodNumber == 8}.first
}

var scheduleDateDescription: String {
Expand All @@ -93,7 +90,7 @@ struct ScheduleDetailView: View {
var shouldFallback: Bool {
return userSettings.preferLegacySchedule ||
developerScheduleOn ||
scheduleDay?.periods?.isEmpty ?? true
scheduleDay?.periods.isEmpty ?? true
}

var horizontalPadding = true
Expand Down

0 comments on commit 8558f3f

Please sign in to comment.