From 67d5ce8ed1192176a78f14b2cc231bbb7a1b3e60 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Tue, 4 Feb 2020 11:42:43 +0100 Subject: [PATCH] FIX: Sort out the route navigation in admin/email-style (#8837) Previously it would go to the "html" page when refreshing on the "css" page, and would open an invalid empty-state page when trying to go to the "email style" tab when already on it. --- .../admin/routes/admin-customize-email-style-index.js.es6 | 7 +++++++ .../admin/routes/admin-customize-email-style.js.es6 | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 app/assets/javascripts/admin/routes/admin-customize-email-style-index.js.es6 diff --git a/app/assets/javascripts/admin/routes/admin-customize-email-style-index.js.es6 b/app/assets/javascripts/admin/routes/admin-customize-email-style-index.js.es6 new file mode 100644 index 00000000000..a6ba0628295 --- /dev/null +++ b/app/assets/javascripts/admin/routes/admin-customize-email-style-index.js.es6 @@ -0,0 +1,7 @@ +import Route from "@ember/routing/route"; + +export default Route.extend({ + beforeModel() { + this.replaceWith("adminCustomizeEmailStyle.edit", "html"); + } +}); diff --git a/app/assets/javascripts/admin/routes/admin-customize-email-style.js.es6 b/app/assets/javascripts/admin/routes/admin-customize-email-style.js.es6 index d63186e0eb0..3ec7b6e1bba 100644 --- a/app/assets/javascripts/admin/routes/admin-customize-email-style.js.es6 +++ b/app/assets/javascripts/admin/routes/admin-customize-email-style.js.es6 @@ -1,10 +1,7 @@ import Route from "@ember/routing/route"; + export default Route.extend({ model() { return this.store.find("email-style"); - }, - - redirect() { - this.transitionTo("adminCustomizeEmailStyle.edit", "html"); } });