From dd1d5bdb259dd6295428c4b5d73676fa18e85659 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Wed, 22 May 2024 10:54:54 -0400 Subject: [PATCH] use support URL for non-local --- .../app/components/AppErrorBoundaryFallback.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx b/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx index 7f1f825ba3..ab1aeefeca 100644 --- a/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx +++ b/invokeai/frontend/web/src/app/components/AppErrorBoundaryFallback.tsx @@ -1,4 +1,5 @@ import { Button, Flex, Heading, Link, Text } from '@invoke-ai/ui-library'; +import { useAppSelector } from 'app/store/storeHooks'; import { toast } from 'features/toast/toast'; import newGithubIssueUrl from 'new-github-issue-url'; import { memo, useCallback, useMemo } from 'react'; @@ -13,6 +14,7 @@ type Props = { const AppErrorBoundaryFallback = ({ error, resetErrorBoundary }: Props) => { const { t } = useTranslation(); + const isLocal = useAppSelector((s) => s.config.isLocal); const handleCopy = useCallback(() => { const text = JSON.stringify(serializeError(error), null, 2); @@ -23,16 +25,19 @@ const AppErrorBoundaryFallback = ({ error, resetErrorBoundary }: Props) => { }); }, [error, t]); - const url = useMemo( - () => - newGithubIssueUrl({ + const url = useMemo(() => { + if (isLocal) { + return newGithubIssueUrl({ user: 'invoke-ai', repo: 'InvokeAI', template: 'BUG_REPORT.yml', title: `[bug]: ${error.name}: ${error.message}`, - }), - [error.message, error.name] - ); + }); + } else { + return 'https://support.invoke.ai/support/tickets/new'; + } + }, [error.message, error.name, isLocal]); + return (