From 70bbb9c420d12eb8b8c058d02ae87422db87c256 Mon Sep 17 00:00:00 2001 From: S SARAVANAN Date: Wed, 27 Nov 2019 18:06:10 +0530 Subject: [PATCH] Fixes #3512: While adding card in the empty list, the card is duplicated issue fixed --- build/beautifier.php | 3 ++- client/js/views/list_view.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build/beautifier.php b/build/beautifier.php index c066495fd..199e45e4f 100644 --- a/build/beautifier.php +++ b/build/beautifier.php @@ -32,7 +32,8 @@ function __beautify_recursive($dir) $path = $dir . DIRECTORY_SEPARATOR . $readdir; // @todo need to handle dynamically if (is_dir($path) && !in_array($readdir, array( - 'vendors' + 'vendors', + 'vendor' ))) { $this->__beautify_recursive($path); } diff --git a/client/js/views/list_view.js b/client/js/views/list_view.js index 72dd6138d..4aff7f3b5 100644 --- a/client/js/views/list_view.js +++ b/client/js/views/list_view.js @@ -1481,7 +1481,10 @@ App.ListView = Backbone.View.extend({ list_id: parseInt(self.model.id) }); if (filtered_cards.length === 1 || self.model.board.cards.length === 0) { - $('#js-card-listing-' + e.attributes.list_id).append(view.render().el); + var existing_card_id = $('#js-card-listing-' + e.attributes.list_id).find('.js-show-modal-card-view:first').data('card_id'); + if (existing_card_id !== parseInt(e.attributes.id)) { + $('#js-card-listing-' + e.attributes.list_id).append(view.render().el); + } } else { self.model.cards.reset(filtered_cards); if (sort_by !== null && sort_direction !== null) {