From 1dab76a274b47385506ce67e4b0737c31bd11bb3 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Tue, 2 Nov 2021 17:11:31 +0530 Subject: [PATCH] Cleaned up mode utils --- ghost/portal/src/utils/check-mode.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ghost/portal/src/utils/check-mode.js b/ghost/portal/src/utils/check-mode.js index 5282856abc..f4289a13d5 100644 --- a/ghost/portal/src/utils/check-mode.js +++ b/ghost/portal/src/utils/check-mode.js @@ -1,6 +1,10 @@ export const isPreviewMode = function () { - const [path, qs] = window.location.hash.substr(1).split('?'); - return (path === '/portal/preview') || (path === '/portal/preview/offer') || (path === '/portal' && qs); + return isNormalPreviewMode() || isOfferPreviewMode(); +}; + +export const isNormalPreviewMode = function () { + const [path] = window.location.hash.substr(1).split('?'); + return (path === '/portal/preview'); }; export const isOfferPreviewMode = function () {