mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 18:40:05 +00:00
Select the latest product level 3 product available when switching products
This commit is contained in:
parent
0f3d1708c0
commit
bf6b3e3601
2 changed files with 12 additions and 2 deletions
|
|
@ -747,7 +747,16 @@ RadarProductManagerImpl::GetLevel3ProductRecord(
|
||||||
|
|
||||||
if (it != level3ProductRecordsMap_.cend())
|
if (it != level3ProductRecordsMap_.cend())
|
||||||
{
|
{
|
||||||
record = util::GetBoundedElementValue(it->second, time);
|
if (time == std::chrono::system_clock::time_point {})
|
||||||
|
{
|
||||||
|
// If a default-initialized time point is given, return the latest
|
||||||
|
// record
|
||||||
|
record = it->second.rbegin()->second;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
record = util::GetBoundedElementValue(it->second, time);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return record;
|
return record;
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,8 @@ void MapWidget::SelectRadarProduct(common::RadarProductGroup group,
|
||||||
|
|
||||||
if (radarProductView != nullptr)
|
if (radarProductView != nullptr)
|
||||||
{
|
{
|
||||||
radarProductView->SelectTime(p->selectedTime_);
|
// Always select the latest product available
|
||||||
|
radarProductView->SelectTime({});
|
||||||
|
|
||||||
if (radarProductViewCreated)
|
if (radarProductViewCreated)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue