mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 18:40:34 -05:00
Use environment checks
This commit is contained in:
@@ -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.`
|
||||
|
||||
Reference in New Issue
Block a user