Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent Flash JS when deleting a Matrix block on the frontend #2799

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/elements/MatrixBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ public function afterSave(bool $isNew)
*/
public function afterDelete()
{
if (!Craft::$app->getRequest()->getIsConsoleRequest()) {
if (!Craft::$app->getRequest()->getIsConsoleRequest() and !Craft::$app->getRequest()->getIsSiteRequest()) {
// Tell the browser to forget about this block
$session = Craft::$app->getSession();
$session->addAssetBundleFlash(MatrixAsset::class);
Expand Down