Skip to content

Commit

Permalink
Fixed condition to show Storage Limit Popup
Browse files Browse the repository at this point in the history
  • Loading branch information
iiLubos committed Aug 30, 2023
1 parent f77231a commit 6a2f51f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions core/merginapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1954,11 +1954,10 @@ void MerginApi::pushStartReplyFinished()
}
else
{
QVariant statusCode = r->attribute( QNetworkRequest::HttpStatusCodeAttribute );
int status = statusCode.toInt();
QString serverMsg = extractServerErrorMsg( r->readAll() );
QString errorMsg = r->errorString();
bool showLimitReachedDialog = status == 400 && serverMsg.contains( QStringLiteral( "You have reached a data limit" ) );
QByteArray data = r->readAll();
QString serverMsg = extractServerErrorMsg( data );
QVariant code = extractServerErrorValue( data, QStringLiteral( "code" ) );
bool showLimitReachedDialog = code.toString() == QStringLiteral( "StorageLimitHit" );

CoreUtils::log( "push " + projectFullName, QStringLiteral( "FAILED - %1. %2" ).arg( r->errorString(), serverMsg ) );

Expand Down Expand Up @@ -1990,7 +1989,6 @@ void MerginApi::pushStartReplyFinished()
int httpCode = r->attribute( QNetworkRequest::HttpStatusCodeAttribute ).toInt();
emit networkErrorOccurred( serverMsg, QStringLiteral( "Mergin API error: pushStartReply" ), httpCode, projectFullName );
}

finishProjectSync( projectFullName, false );
}
}
Expand Down

1 comment on commit 6a2f51f

@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 23.08.453811 just submitted!

Please sign in to comment.