Commit efe58f9d by Shailesh Aher

Removed unecessary unknown moon phase handling, and corrected moon phase cell visible condition

parent 119ed138
......@@ -147,6 +147,8 @@ class MoonPhaseCell: UITableViewCell {
MoonPhaseCell.nowDateFormatter.timeZone = today?.timeZone
moonTypeLabel.text = today?.moonPhase?.localized
moonTypeImageView.image = today?.moonPhase?.image
//TODO:- Set default moon image if we don't have phase
moonImageView.image = today?.moonPhase?.pathImage
guard
......
......@@ -230,7 +230,7 @@ class TodayCellFactory: CellFactory {
rowsToHide.insert(.airQuality)
}
if location?.today?.moonset == nil && (location?.today?.moonrise == nil || location?.today?.approximateMoonrise == nil) {
if location?.today?.moonset == nil || (location?.today?.moonrise == nil && location?.today?.approximateMoonrise == nil) {
rowsToHide.insert(.moon)
}
......
......@@ -36,7 +36,7 @@ open class CoreCurrentWeather: _CoreCurrentWeather, CoreDataAppModelConvertable
result.moonset = self.moonset
result.approximateMoonrise = self.approximateMoonrise
result.moonState = try CoreDataUtils.appValueOptional(name: "moonState", value: self.moonState, in: self)
result.moonPhase = try CoreDataUtils.appValueOptional(name: "moonPhase", value: self.moonPhase, in: self) ?? .unknown
result.moonPhase = try CoreDataUtils.appValueOptional(name: "moonPhase", value: self.moonPhase, in: self)
return result
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment