Commit 80bc9840 by Demid Merzlyakov

Merge branch 'bug/moon_phase_disaapearing' into 'develop'

Bug/moon phase disaapearing

See merge request oneweather/1weather-ios-new!1
parents 15e1a49d efe58f9d
......@@ -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)
}
......
......@@ -39,7 +39,7 @@ public struct CurrentWeather: Equatable, Hashable {
public var moonState: CelestialState? = .normal
public var moonPhase: MoonPhase? = .unknown
public init(lastTimeUpdated: Date, date: Date, timeZone: TimeZone, weekDay: WeekDay, type: WeatherType = .unknown, isDay: Bool, uv: Int? = nil, minTemp: Temperature? = nil, maxTemp: Temperature? = nil, windSpeed: WindSpeed? = nil, windDirection: WindDirection? = nil, precipitationProbability: Percent? = nil, temp: Temperature? = nil, dewPoint: Temperature? = nil, apparentTemp: Temperature? = nil, humidity: Percent? = nil, visibility: Visibility? = nil, pressure: Pressure? = nil, sunrise: Date? = nil, sunset: Date? = nil, sunState: CelestialState? = .normal, moonrise: Date? = nil, moonset: Date? = nil, approximateMoonrise: Date? = nil, moonState: CelestialState? = .normal, moonPhase: MoonPhase? = .unknown) {
public init(lastTimeUpdated: Date, date: Date, timeZone: TimeZone, weekDay: WeekDay, type: WeatherType = .unknown, isDay: Bool, uv: Int? = nil, minTemp: Temperature? = nil, maxTemp: Temperature? = nil, windSpeed: WindSpeed? = nil, windDirection: WindDirection? = nil, precipitationProbability: Percent? = nil, temp: Temperature? = nil, dewPoint: Temperature? = nil, apparentTemp: Temperature? = nil, humidity: Percent? = nil, visibility: Visibility? = nil, pressure: Pressure? = nil, sunrise: Date? = nil, sunset: Date? = nil, sunState: CelestialState? = .normal, moonrise: Date? = nil, moonset: Date? = nil, approximateMoonrise: Date? = nil, moonState: CelestialState? = .normal, moonPhase: MoonPhase? = nil) {
self.lastTimeUpdated = lastTimeUpdated
self.date = date
self.timeZone = timeZone
......
......@@ -100,7 +100,7 @@ struct WdtSurfaceObservation: Codable {
let isDay = guessIsDay(currentDate: date, context: originalLocation)
var result = CurrentWeather(lastTimeUpdated: updatedAt, date: date, timeZone: timeZone, weekDay: weekDay, isDay: isDay)
var result = CurrentWeather(lastTimeUpdated: updatedAt, date: date, timeZone: timeZone, weekDay: weekDay, isDay: isDay, moonPhase: nil)
if let weatherCode = self.weatherCode {
result.type = WdtWeatherCode(rawValue: weatherCode)?.toAppModel() ?? .unknown
}
......
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