From a24442317ab70a5ca5f86a5c5d2d1a6c33c686de Mon Sep 17 00:00:00 2001 From: Henry Hein Date: Tue, 21 Mar 2023 09:34:46 +0800 Subject: [PATCH] fix: Template is not applicaable error popup --- src/trade/tradeDialog.es6 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/trade/tradeDialog.es6 b/src/trade/tradeDialog.es6 index 7e858bd69..f6059c3e0 100644 --- a/src/trade/tradeDialog.es6 +++ b/src/trade/tradeDialog.es6 @@ -117,7 +117,8 @@ function get_current_template(state) { function set_current_template(state, tpl) { state.template.name = tpl.name; var warn = function(msg) { $.growl.warning({ message: msg || 'Template applied partially.'.i18n() }); } - if(!_.find(state.categories.array, tpl.categories_value)) { + const doesTemplateExist = (_.some(state.categories.array, { contract_category: tpl.categories_value.contract_category })); + if(!doesTemplateExist) { $.growl.error({ message: 'Template is not applicable.'.i18n() }); return; }