Fixed FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS clear shopping list confirm message handling (fixes #1315)

This commit is contained in:
Bernd Bestel 2021-08-17 18:05:32 +02:00
parent cebf7a3e54
commit 3608eec8fb
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 10 additions and 1 deletions

View File

@ -2244,3 +2244,6 @@ msgstr ""
msgid "Section"
msgstr ""
msgid "Are you sure to empty the shopping list?"
msgstr ""

View File

@ -195,8 +195,14 @@ $(document).on('click', '#add-overdue-expired-products', function(e)
$(document).on('click', '#clear-shopping-list', function(e)
{
var confirmMessage = __t('Are you sure to empty shopping list "%s"?', $("#selected-shopping-list option:selected").text());
if (!BoolVal(Grocy.FeatureFlags.GROCY_FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS))
{
confirmMessage = __t('Are you sure to empty the shopping list?');
}
bootbox.confirm({
message: __t('Are you sure to empty shopping list "%s"?', $("#selected-shopping-list option:selected").text()),
message: confirmMessage,
closeButton: false,
buttons: {
confirm: {