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

Fix the 'Re-open Browser' button becomming unresponsive #8866

Merged
merged 2 commits into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions changelog/unreleased/8866
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: The `Re-open Browser` now always does what it says

Under certain conditions the previous authentication run might have failed and the button
became unresponsive, we now start a new authentication in that case.

https://github.com/owncloud/client/pull/8866
2 changes: 1 addition & 1 deletion src/gui/accountsettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<item>
<widget class="QToolButton" name="openBrowserButton">
<property name="text">
<string>Re-open Browser </string>
<string>Re-open Browser</string>
</property>
</widget>
</item>
Expand Down
13 changes: 13 additions & 0 deletions src/gui/creds/httpcredentialsgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ namespace OCC {

Q_LOGGING_CATEGORY(lcHttpCredentialsGui, "sync.credentials.http.gui", QtInfoMsg)

void HttpCredentialsGui::openBrowser()
{
OC_ASSERT(isUsingOAuth());
if (isUsingOAuth()) {
if (_asyncAuth) {
_asyncAuth->openBrowser();
} else {
qCWarning(lcHttpCredentialsGui) << "There is no authentication job running, did the previous attempt fail?";
askFromUserAsync();
}
}
}

void HttpCredentialsGui::askFromUser()
{
// This function can be called from AccountState::slotInvalidCredentials,
Expand Down
8 changes: 1 addition & 7 deletions src/gui/creds/httpcredentialsgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@ class HttpCredentialsGui : public HttpCredentials
_refreshToken = refreshToken;
}

void openBrowser()
{
if (isUsingOAuth() && _asyncAuth)
{
_asyncAuth->openBrowser();
}
}
void openBrowser();
/**
* This will query the server and either uses OAuth via _asyncAuth->start()
* or call showDialog to ask the password
Expand Down