diff --git a/.env b/.env deleted file mode 100644 index 3ce08e1..0000000 --- a/.env +++ /dev/null @@ -1,2 +0,0 @@ -VITE_API_BASE_URL=https://my-public-node-1.projscale.dev/api/v1 -VITE_SENTRY_DSN=https://4ef061d22eee4876ad8bb313134ebf009ed96c9da98742289ff733a301fcd184@k1.hawk.so/0 \ No newline at end of file diff --git a/.gitignore b/.gitignore index ff0401a..65e13f6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ node_modules .DS_Store dist -.env +.env* \ No newline at end of file diff --git a/src/env.d.ts b/src/env.d.ts index 8304c33..6c210c7 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1,7 +1,11 @@ /// interface ImportMetaEnv { - readonly VITE_API_BASE_URL: string; + readonly VITE_SENTRY_DSN: string + readonly VITE_API_BASE_URL: string + readonly MODE: 'development' | 'production' + readonly PROD: boolean + readonly DEV: boolean } interface ImportMeta { diff --git a/src/pages/root/steps/welcome-step/index.tsx b/src/pages/root/steps/welcome-step/index.tsx index ee75500..fe6459c 100644 --- a/src/pages/root/steps/welcome-step/index.tsx +++ b/src/pages/root/steps/welcome-step/index.tsx @@ -3,6 +3,7 @@ import { useTonConnectUI } from "@tonconnect/ui-react"; import { Button } from "~/shared/ui/button"; import { useAuth } from "~/shared/services/auth"; +import { Address } from "@ton/core"; type WelcomeStepProps = { nextStep(): void; @@ -12,7 +13,7 @@ export const WelcomeStep = ({ nextStep }: WelcomeStepProps) => { const [tonConnectUI] = useTonConnectUI(); const [isLoaded, setLoaded] = useState(false); const [isConnected, setIsConnected] = useState(tonConnectUI.connected); - + const [address, setAddress] = useState(''); console.log("πŸ’©πŸ’©πŸ’© enter WelcomeStep"); const auth = useAuth(); @@ -33,6 +34,16 @@ export const WelcomeStep = ({ nextStep }: WelcomeStepProps) => { }; }, [tonConnectUI]); + useEffect(() => { + if(tonConnectUI.account){ + setAddress(Address.parse(tonConnectUI.account?.address).toString({ + bounceable: false, + urlSafe: true, + testOnly: false, + }),) + } + }, [tonConnectUI.account]); + const handleNextClick = async () => { if (tonConnectUI.connected) { await auth.mutateAsync(); @@ -122,8 +133,8 @@ export const WelcomeStep = ({ nextStep }: WelcomeStepProps) => { <>

- Π’Ρ‹ зарСгистрированы ΠΏΠΎΠ΄ кошСльком: - {tonConnectUI.account?.address.slice(2, 9)}...{tonConnectUI.account?.address.slice(-4)} + Π’Ρ‹ зарСгистрированы ΠΏΠΎΠ΄ кошСльком:
+ {address}

diff --git a/src/pages/view-content/components/error-modal/index.tsx b/src/pages/view-content/components/error-modal/index.tsx index b60c8cc..0837717 100644 --- a/src/pages/view-content/components/error-modal/index.tsx +++ b/src/pages/view-content/components/error-modal/index.tsx @@ -28,7 +28,7 @@ export const ErrorModal = ({ } >

- Ошибка запроса Ρ‚Ρ€Π°Π½Π·Π°ΠΊΡ†ΠΈΠΈ + Ошибка запроса Ρ‚Ρ€Π°Π½Π·Π°ΠΊΡ†ΠΈΠΈ

НС ΡƒΠ΄Π°Π»ΠΎΡΡŒ ΠΎΡ‚ΠΏΡ€Π°Π²ΠΈΡ‚ΡŒ запрос Π½Π° Π²Ρ‹ΠΏΠΎΠ»Π½Π΅Π½ΠΈΠ΅ Ρ‚Ρ€Π°Π½Π·Π°ΠΊΡ†ΠΈΠΈ. diff --git a/src/pages/view-content/index.tsx b/src/pages/view-content/index.tsx index 3664400..d96a6b1 100644 --- a/src/pages/view-content/index.tsx +++ b/src/pages/view-content/index.tsx @@ -134,13 +134,24 @@ export const ViewContentPage = () => { /> } -

); diff --git a/src/shared/services/sentry/index.ts b/src/shared/services/sentry/index.ts index 7991464..75cb7a8 100644 --- a/src/shared/services/sentry/index.ts +++ b/src/shared/services/sentry/index.ts @@ -7,7 +7,7 @@ import { useNavigationType, } from "react-router-dom"; - +console.log(import.meta.env); Sentry.init({ dsn: import.meta.env.VITE_SENTRY_DSN, integrations: [ @@ -22,22 +22,23 @@ Sentry.init({ }), Sentry.replayIntegration(), ], - + enabled: import.meta.env.PROD, // Only enable in production + environment: import.meta.env.MODE, // Set the environment // Set tracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // Learn more at // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate - tracesSampleRate: 1.0, + tracesSampleRate: 0, // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: [ - /^\//, - new RegExp(`^${import.meta.env.VITE_API_BASE_URL}`), + // /^\//, + // new RegExp(`^${import.meta.env.VITE_API_BASE_URL}`), ], // Capture Replay for 10% of all sessions, // plus for 100% of sessions with an error // Learn more at // https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration - replaysSessionSampleRate: 0.1, - replaysOnErrorSampleRate: 1.0, + replaysSessionSampleRate: 0, + replaysOnErrorSampleRate: 0, });