forked from organicmaps/organicmaps
[MAPSME-6541] Added completion handler calls for all cases of ugc upload.
This commit is contained in:
parent
7e0e4d98cb
commit
a156551ce8
1 changed files with 11 additions and 3 deletions
|
@ -3379,11 +3379,14 @@ void Framework::FillLocalExperts(FeatureType const & ft, place_page::Info & info
|
|||
|
||||
void Framework::UploadUGC(User::CompleteUploadingHandler const & onCompleteUploading)
|
||||
{
|
||||
if (GetPlatform().ConnectionStatus() == Platform::EConnectionType::CONNECTION_NONE)
|
||||
return;
|
||||
if (GetPlatform().ConnectionStatus() == Platform::EConnectionType::CONNECTION_NONE ||
|
||||
!m_user.IsAuthenticated())
|
||||
{
|
||||
if (onCompleteUploading != nullptr)
|
||||
onCompleteUploading(false);
|
||||
|
||||
if (!m_user.IsAuthenticated())
|
||||
return;
|
||||
}
|
||||
|
||||
m_ugcApi->GetUGCToSend([this, onCompleteUploading](string && json)
|
||||
{
|
||||
|
@ -3398,6 +3401,11 @@ void Framework::UploadUGC(User::CompleteUploadingHandler const & onCompleteUploa
|
|||
m_ugcApi->SendingCompleted();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (onCompleteUploading != nullptr)
|
||||
onCompleteUploading(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue