Skip to content

Commit

Permalink
Connection::logout: ignore ContentAccessError
Browse files Browse the repository at this point in the history
Closes #316.
  • Loading branch information
KitsuneRal committed Apr 16, 2019
1 parent 4c9ed0c commit fa41fd7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,14 @@ void Connection::checkAndConnect(const QString& userId,
void Connection::logout()
{
auto job = callApi<LogoutJob>();
connect( job, &LogoutJob::success, this, [this] {
stopSync();
d->data->setToken({});
emit stateChanged();
emit loggedOut();
connect( job, &LogoutJob::finished, this, [job,this] {
if (job->status().good() || job->error() == BaseJob::ContentAccessError)
{
stopSync();
d->data->setToken({});
emit stateChanged();
emit loggedOut();
}
});
}

Expand Down

0 comments on commit fa41fd7

Please sign in to comment.