From fc651747ca6665b16165d0496d3221e755686771 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 18 Dec 2019 10:38:26 +0100 Subject: [PATCH] Fix error message not displayed when creating a invitation link --- www/common/common-ui-elements.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 053059a55..d14545368 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1641,6 +1641,7 @@ define([ var dismissButton = h('span.fa.fa-times'); var linkContent = h('div.cp-share-modal', [ h('p', Messages.team_inviteLinkTitle ), // XXX + linkError = h('div.alert.alert-danger.cp-teams-invite-alert', {style : 'display: none;'}), linkForm = h('div.cp-teams-invite-form', [ linkName = h('input', { placeholder: Messages.team_inviteLinkTempName // XXX @@ -1677,7 +1678,6 @@ define([ }, h('textarea', { readonly: 'readonly' })), - linkError = h('div.alert.alert-danger.cp-teams-invite-alert', {style : 'display: none;'}), linkWarning = h('div.cp-teams-invite-alert.alert.alert-warning.dismissable', { style: "display: none;" }, [ @@ -1735,14 +1735,14 @@ define([ hash: hash, teamId: config.teamId, seeds: seeds, - }, waitFor(function (obj) { - if (obj && obj.error) { + }, waitFor(function (error) { + if (error) { waitFor.abort(); $(linkSpin).hide(); $(linkForm).show(); // XXX DB: check this is the right place to put things back $nav.find('button.cp-teams-invite-create').show(); $nav.find('button.cp-teams-invite-copy').hide(); - return void $(linkError).text(Messages.team_inviteLinkError+obj.error).show(); // XXX + return void $(linkError).text(Messages.team_inviteLinkError+error).show(); // XXX } // Display result here $(linkSpin).hide();