From 650733d51b390421f8febf2ea334173d6e7cfa1f Mon Sep 17 00:00:00 2001
From: Jed Fox <git@jedfox.com>
Date: Sun, 1 Jan 2023 10:28:14 -0500
Subject: [PATCH] Use environment checks

---
 .../src/components/modals/ManageRulesModal.js               | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/packages/desktop-client/src/components/modals/ManageRulesModal.js b/packages/desktop-client/src/components/modals/ManageRulesModal.js
index d0409b6f3..9362a1ee5 100644
--- a/packages/desktop-client/src/components/modals/ManageRulesModal.js
+++ b/packages/desktop-client/src/components/modals/ManageRulesModal.js
@@ -1,12 +1,16 @@
 import React, { useState } from 'react';
 
 import { Modal } from 'loot-design/src/components/common';
+import {
+  isDevelopmentEnvironment,
+  isPreviewEnvironment
+} from 'loot-design/src/util/environment';
 
 import ManageRules from '../ManageRules';
 
 export default function ManageRulesModal({ modalProps, payeeId }) {
   let [loading, setLoading] = useState(true);
-  if (process.env.NODE_ENV === 'development') {
+  if (isDevelopmentEnvironment() || isPreviewEnvironment()) {
     if (location.pathname !== '/payees') {
       throw new Error(
         `Possibly invalid use of ManageRulesModal, add the current url '${location.pathname}' to the allowlist if you're confident the modal can never appear on top of the '/rules' page.`
-- 
GitLab