From a246d8ac153ef2fafe659baa5096b78f3c17b214 Mon Sep 17 00:00:00 2001 From: Abdulwahaab Ahmed Date: Wed, 8 May 2019 17:50:24 -0400 Subject: [PATCH] Renaming var flash to flashData --- example/app/assets/javascripts/flash_messages.js | 10 +++++----- .../shopify_app/install/templates/flash_messages.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/example/app/assets/javascripts/flash_messages.js b/example/app/assets/javascripts/flash_messages.js index 77e057843..8d2fd64c2 100644 --- a/example/app/assets/javascripts/flash_messages.js +++ b/example/app/assets/javascripts/flash_messages.js @@ -2,14 +2,14 @@ var eventName = typeof(Turbolinks) !== 'undefined' ? 'turbolinks:load' : 'DOMCon if (!document.documentElement.hasAttribute("data-turbolinks-preview")) { document.addEventListener(eventName, function flash() { - var flash = JSON.parse(document.getElementById('shopify-app-flash').dataset.flash); + var flashData = JSON.parse(document.getElementById('shopify-app-flash').dataset.flash); - if (flash.notice) { - ShopifyApp.flashNotice(flash.notice); + if (flashData.notice) { + ShopifyApp.flashNotice(flashData.notice); } - if (flash.error) { - ShopifyApp.flashError(flash.error); + if (flashData.error) { + ShopifyApp.flashError(flashData.error); } document.removeEventListener(eventName, flash) diff --git a/lib/generators/shopify_app/install/templates/flash_messages.js b/lib/generators/shopify_app/install/templates/flash_messages.js index 77e057843..8d2fd64c2 100644 --- a/lib/generators/shopify_app/install/templates/flash_messages.js +++ b/lib/generators/shopify_app/install/templates/flash_messages.js @@ -2,14 +2,14 @@ var eventName = typeof(Turbolinks) !== 'undefined' ? 'turbolinks:load' : 'DOMCon if (!document.documentElement.hasAttribute("data-turbolinks-preview")) { document.addEventListener(eventName, function flash() { - var flash = JSON.parse(document.getElementById('shopify-app-flash').dataset.flash); + var flashData = JSON.parse(document.getElementById('shopify-app-flash').dataset.flash); - if (flash.notice) { - ShopifyApp.flashNotice(flash.notice); + if (flashData.notice) { + ShopifyApp.flashNotice(flashData.notice); } - if (flash.error) { - ShopifyApp.flashError(flash.error); + if (flashData.error) { + ShopifyApp.flashError(flashData.error); } document.removeEventListener(eventName, flash)