Skip to content

Commit

Permalink
[fix] 修复缓存读取同名地区错误的问题
Browse files Browse the repository at this point in the history
Fix #35
  • Loading branch information
zxbmmmmmmmmm committed Feb 24, 2024
1 parent c68f2e0 commit 06f3bda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FluentWeather.Uwp/Helpers/CacheHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static async Task<WeatherCacheBase> GetWeatherCache(GeolocationBase locat
var text = await FileIO.ReadTextAsync(item);
var data = JsonSerializer.Deserialize<List<WeatherCacheBase>>(text);
data.RemoveAll(p => DateTime.Now - p.UpdatedTime > TimeSpan.FromMinutes(10));//删除过期的数据
return data.Find(p => p.Location.Name == location.Name);
return data.Find(p => p.Location.Name == location.Name&&p.Location.AdmDistrict == location.AdmDistrict);
}
catch
{
Expand Down

0 comments on commit 06f3bda

Please sign in to comment.