Skip to content

Commit

Permalink
checking if user is logged without triggering anything
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed Jan 28, 2025
1 parent 50e7b68 commit 7f5425a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/merginapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3966,7 +3966,7 @@ DownloadQueueItem::DownloadQueueItem( const QString &fp, qint64 s, int v, qint64

void MerginApi::reloadProjectRole( const QString &projectFullName )
{
if ( projectFullName.isEmpty() )
if ( projectFullName.isEmpty() || !isLoggedIn() )
{
return;
}
Expand Down Expand Up @@ -4053,3 +4053,8 @@ void MerginApi::setNetworkManager( QNetworkAccessManager *manager )

emit networkManagerChanged();
}

bool MerginApi::isLoggedIn() const
{
return mUserAuth->hasAuthData() && !mUserAuth->authToken().isEmpty();
}
5 changes: 5 additions & 0 deletions core/merginapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,11 @@ class MerginApi: public QObject
*/
void setNetworkManager( QNetworkAccessManager *manager );

/**
* Returns whether user is currently logged in
*/
Q_INVOKABLE bool isLoggedIn() const;

signals:
void apiSupportsSubscriptionsChanged();
void supportsSelectiveSyncChanged();
Expand Down

1 comment on commit 7f5425a

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

Please sign in to comment.