Story weather display

This commit is contained in:
Ilya Laktyushin
2024-07-18 04:45:10 +04:00
parent a6c7e92d6f
commit f4cc9d1aad
8 changed files with 245 additions and 115 deletions

View File

@@ -58,18 +58,14 @@ func getWeather(context: AccountContext) -> Signal<StickerPickerScreen.Weather,
return getWeatherData(context: context, location: location)
|> mapToSignal { weather in
if let weather {
return context.animatedEmojiStickers
|> take(1)
|> mapToSignal { result in
if let match = result[weather.emoji.strippedEmoji]?.first {
return .single(.loaded(StickerPickerScreen.Weather.LoadedWeather(
emoji: weather.emoji.strippedEmoji,
emojiFile: match.file,
temperature: weather.temperature
)))
} else {
return .single(.none)
}
if let match = context.animatedEmojiStickersValue[weather.emoji.strippedEmoji]?.first {
return .single(.loaded(StickerPickerScreen.Weather.LoadedWeather(
emoji: weather.emoji.strippedEmoji,
emojiFile: match.file,
temperature: weather.temperature
)))
} else {
return .single(.none)
}
} else {
return .single(.none)