mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-21 15:36:50 -05:00
Bug/1617 rules modal error (#6625)
* Remove error thrown and nonprod check * Formatting * Added release notes * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
// @ts-strict-ignore
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocation } from 'react-router';
|
||||
|
||||
import { isNonProductionEnvironment } from 'loot-core/shared/environment';
|
||||
|
||||
import {
|
||||
Modal,
|
||||
@@ -21,14 +18,6 @@ type ManageRulesModalProps = Extract<
|
||||
export function ManageRulesModal({ payeeId }: ManageRulesModalProps) {
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(true);
|
||||
const location = useLocation();
|
||||
if (isNonProductionEnvironment()) {
|
||||
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.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal name="manage-rules" isLoading={loading}>
|
||||
|
||||
6
upcoming-release-notes/6625.md
Normal file
6
upcoming-release-notes/6625.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [RMcGhee]
|
||||
---
|
||||
|
||||
Remove url check that throws error in development
|
||||
Reference in New Issue
Block a user