Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling attempt to upload a project after reaching the project limit #3450

Merged
merged 6 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 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,17 @@ void SynchronizationManager::onProjectSyncProgressChanged( const QString &projec

}

void SynchronizationManager::onProjectCreated( const QString &projectFullName, bool result )
{
QString projectNamespace, projectName;
MerginApi::extractProjectName( projectFullName, projectNamespace, projectName );

VitorVieiraZ marked this conversation as resolved.
Show resolved Hide resolved
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 );

VitorVieiraZ marked this conversation as resolved.
Show resolved Hide resolved
if ( showLimitReachedDialog )
{
Expand Down
Loading