From 54d61cd24d8a81dd105d9c049d44dcd6d1b3d397 Mon Sep 17 00:00:00 2001 From: David Cook Date: Fri, 1 Dec 2023 12:40:30 +1100 Subject: [PATCH] Don't show flashes until everything else is done. Mario reported that it was showing before the loading spinner had gone. Technically the loading spinner doesn't hide until after the reflex is finished, but hopefully this is close enough. --- app/reflexes/products_reflex.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/reflexes/products_reflex.rb b/app/reflexes/products_reflex.rb index 8d2343f4f0..c040f76f69 100644 --- a/app/reflexes/products_reflex.rb +++ b/app/reflexes/products_reflex.rb @@ -39,12 +39,12 @@ class ProductsReflex < ApplicationReflex if product_set.save flash[:success] = I18n.t('admin.products_v3.bulk_update.success') - broadcast_admin_flashes elsif product_set.errors.present? @error_counts = { saved: product_set.saved_count, invalid: product_set.invalid.count } end render_products_form + broadcast_admin_flashes if flash.any? end private