浏览代码

Merge pull request #1463 from nextcloud/fixSnackbarOnWebLogin

Fix Snackbar on wrong login with old server
Tobias Kaminsky 7 年之前
父节点
当前提交
ac58ee007b
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. 7 6
      src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java

+ 7 - 6
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -1811,20 +1811,21 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
             }
 
         } else {    // authorization fail due to client side - probably wrong credentials
-            if (!webViewLoginMethod) {
-                updateAuthStatusIconAndText(result);
-                showAuthStatus();
-            } else {
+            if (webViewLoginMethod) {
                 mLoginWebView = (WebView) findViewById(R.id.login_webview);
                 initWebViewLogin(mServerInfo.mBaseUrl);
+
+                Snackbar.make(mLoginWebView, getString(R.string.auth_access_failed) + ": " + result.getLogMessage(),
+                        Snackbar.LENGTH_LONG).show();
+            } else {
+                updateAuthStatusIconAndText(result);
+                showAuthStatus();
             }
             // reset webview
             webViewPassword = null;
             webViewUser = null;
             deleteCookies();
 
-            Snackbar.make(mLoginWebView, getString(R.string.auth_access_failed) + ": " + result.getLogMessage(),
-                    Snackbar.LENGTH_LONG).show();
             Log_OC.d(TAG, "Access failed: " + result.getLogMessage());
         }
     }