From 1d9490f60bfae4e1c35d9b94d207eb65fcd9fcc1 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 8 Mar 2019 15:34:30 +0000 Subject: [PATCH] Files: Fix buggy dialogs when more than one external storage requires authentication --- plugins/kolab_files/kolab_files.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js index df777b0b..a59445f4 100644 --- a/plugins/kolab_files/kolab_files.js +++ b/plugins/kolab_files/kolab_files.js @@ -4136,15 +4136,15 @@ function kolab_files_ui() delete result.auth_errors[i]; } }); + $.extend(this.auth_errors, result.auth_errors); } // ask for password to the first storage on the list var ref = this; $.each(this.auth_errors || [], function(i, v) { - file_api.folder_list_auth_dialog(i, v); - delete ref.auth_errors[i]; - return false; + if (file_api.folder_list_auth_dialog(i, v)) + return false; }); }; @@ -4155,6 +4155,9 @@ function kolab_files_ui() dialog = $('#files-folder-auth-dialog'), content = this.folder_list_auth_form(driver); + if ($('#files-folder-auth-dialog').is(':visible')) + return false; + dialog.find('table.propform').remove(); $('.auth-options', dialog).before(content); @@ -4190,13 +4193,17 @@ function kolab_files_ui() } }); }); + + return true; }; // folder_auth handler this.folder_auth_response = function(response, params) { - if (!this.response(response)) + if (!this.response(response)) { + this.folder_list_auth_errors(); return; + } delete this.auth_errors[response.result.folder];