diff --git a/src/Screens.tsx b/src/Screens.tsx index 718c0e29..d353ab9b 100644 --- a/src/Screens.tsx +++ b/src/Screens.tsx @@ -1,3 +1,4 @@ +import analytics from '@components/analytics' import { HeaderLeft } from '@components/Header' import { displayMessage, Message } from '@components/Message' import navigationRef from '@helpers/navigationRef' @@ -21,7 +22,6 @@ import { updateFilters } from '@utils/slices/instances/updateFilters' import { getInstanceActive, getInstances } from '@utils/slices/instancesSlice' import { useTheme } from '@utils/styles/ThemeManager' import { themes } from '@utils/styles/themes' -import * as Analytics from 'expo-firebase-analytics' import * as Linking from 'expo-linking' import { addScreenshotListener } from 'expo-screen-capture' import React, { useCallback, useEffect, useRef, useState } from 'react' @@ -118,7 +118,7 @@ const Screens: React.FC = ({ localCorrupt }) => { } if (previousRoute?.name !== currentRoute?.name) { - Analytics.logEvent('screen_view', { screen_name: currentRoute?.name }) + analytics('screen_view', { screen_name: currentRoute?.name }) Sentry.Native.setContext('page', { previous: previousRoute, current: currentRoute diff --git a/src/api/general.ts b/src/api/general.ts index 20849953..270286ce 100644 --- a/src/api/general.ts +++ b/src/api/general.ts @@ -58,14 +58,14 @@ const apiGeneral = async ({ }) }) .catch(error => { - if (sentry && Math.random() < 0.01) { - Sentry.Native.setExtras({ - API: 'general', - ...(error.response && { response: error.response }), - ...(error.request && { request: error.request }) - }) - Sentry.Native.captureException(error) - } + // if (sentry && Math.random() < 0.01) { + // Sentry.Native.setExtras({ + // API: 'general', + // ...(error.response && { response: error.response }), + // ...(error.request && { request: error.request }) + // }) + // Sentry.Native.captureException(error) + // } if (error.response) { // The request was made and the server responded with a status code diff --git a/src/api/instance.ts b/src/api/instance.ts index 81236aeb..7a2558b7 100644 --- a/src/api/instance.ts +++ b/src/api/instance.ts @@ -98,14 +98,14 @@ const apiInstance = async ({ }) }) .catch(error => { - if (Math.random() < 0.001) { - Sentry.Native.setExtras({ - API: 'instance', - ...(error.response && { response: error.response }), - ...(error.request && { request: error.request }) - }) - Sentry.Native.captureException(error) - } + // if (Math.random() < 0.001) { + // Sentry.Native.setExtras({ + // API: 'instance', + // ...(error.response && { response: error.response }), + // ...(error.request && { request: error.request }) + // }) + // Sentry.Native.captureException(error) + // } if (error.response) { // The request was made and the server responded with a status code diff --git a/src/components/Timeline/Shared/Filtered.tsx b/src/components/Timeline/Shared/Filtered.tsx index 6736fda2..9892632f 100644 --- a/src/components/Timeline/Shared/Filtered.tsx +++ b/src/components/Timeline/Shared/Filtered.tsx @@ -41,7 +41,7 @@ export const shouldFilter = ({ }) => { const instance = getInstance(store.getState()) const ownAccount = - getInstanceAccount(store.getState())?.id === status.account.id + getInstanceAccount(store.getState())?.id === status.account?.id let shouldFilter = false if (!ownAccount) { diff --git a/src/components/analytics.ts b/src/components/analytics.ts index b028ce21..dd205a63 100644 --- a/src/components/analytics.ts +++ b/src/components/analytics.ts @@ -1,7 +1,7 @@ import * as Analytics from 'expo-firebase-analytics' const analytics = (event: string, params?: { [key: string]: any }) => { - Analytics.logEvent(event, params) + Analytics.logEvent(event, params).catch(() => {}) } export default analytics diff --git a/src/screens/Tabs/Shared/Account/Attachments.tsx b/src/screens/Tabs/Shared/Account/Attachments.tsx index 5c09e859..a47fb474 100644 --- a/src/screens/Tabs/Shared/Account/Attachments.tsx +++ b/src/screens/Tabs/Shared/Account/Attachments.tsx @@ -91,8 +91,10 @@ const AccountAttachments = React.memo( return (