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.
This commit is contained in:
David Cook
2023-12-01 12:40:30 +11:00
parent 6dc04c458c
commit 54d61cd24d

View File

@@ -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