Skip to content

Commit

Permalink
Handling attempt to upload a project after reaching the project limit (
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed May 24, 2024
1 parent 22d1cf7 commit f8d7e37
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions app/synchronizationmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SynchronizationManager::SynchronizationManager(
QObject::connect( mMerginApi, &MerginApi::pushCanceled, this, &SynchronizationManager::onProjectSyncCanceled );
QObject::connect( mMerginApi, &MerginApi::syncProjectFinished, this, &SynchronizationManager::onProjectSyncFinished );
QObject::connect( mMerginApi, &MerginApi::networkErrorOccurred, this, &SynchronizationManager::onProjectSyncFailure );
QObject::connect( mMerginApi, &MerginApi::projectCreated, this, &SynchronizationManager::onProjectCreated );
QObject::connect( mMerginApi, &MerginApi::projectAttachedToMergin, this, &SynchronizationManager::onProjectAttachedToMergin );
QObject::connect( mMerginApi, &MerginApi::syncProjectStatusChanged, this, &SynchronizationManager::onProjectSyncProgressChanged );
QObject::connect( mMerginApi, &MerginApi::projectReloadNeededAfterSync, this, &SynchronizationManager::onProjectReloadNeededAfterSync );
Expand Down Expand Up @@ -230,6 +231,19 @@ void SynchronizationManager::onProjectSyncProgressChanged( const QString &projec

}

void SynchronizationManager::onProjectCreated( const QString &projectFullName, bool result )
{
// 'projectFullName' is in the format "namespace/projectName" and 'mSyncProcess' stores
// projects that were not previously uploaded to the server in the format "projectName".
QString projectNamespace, projectName;
MerginApi::extractProjectName( projectFullName, projectNamespace, projectName );

if ( !result && mSyncProcesses.contains( projectName ) )
{
mSyncProcesses.remove( projectName );
}
}

void SynchronizationManager::onProjectSyncFailure(
const QString &message,
const QString &topic,
Expand Down
1 change: 1 addition & 0 deletions app/synchronizationmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class SynchronizationManager : public QObject
void onProjectSyncFailure( const QString &message, const QString &topic, int httpCode, const QString &projectFullName );
void onProjectAttachedToMergin( const QString &projectFullName, const QString &previousName );
void onProjectReloadNeededAfterSync( const QString &projectFullName );
void onProjectCreated( const QString &projectName, bool result );

private:

Expand Down
2 changes: 1 addition & 1 deletion core/merginapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ void MerginApi::createProjectFinished()

CoreUtils::log( "create " + projectFullName, message );

emit projectCreated( projectFullName, false );
emit projectCreated( projectName, false );

if ( showLimitReachedDialog )
{
Expand Down

1 comment on commit f8d7e37

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 24.5.624411 just submitted!

Please sign in to comment.