mirror of
				https://github.com/tooot-app/app
				synced 2025-06-05 22:19:13 +02:00 
			
		
		
		
	Fix bugs
This commit is contained in:
		| @@ -1,3 +1,4 @@ | |||||||
|  | import analytics from '@components/analytics' | ||||||
| import { HeaderLeft } from '@components/Header' | import { HeaderLeft } from '@components/Header' | ||||||
| import { displayMessage, Message } from '@components/Message' | import { displayMessage, Message } from '@components/Message' | ||||||
| import navigationRef from '@helpers/navigationRef' | import navigationRef from '@helpers/navigationRef' | ||||||
| @@ -21,7 +22,6 @@ import { updateFilters } from '@utils/slices/instances/updateFilters' | |||||||
| import { getInstanceActive, getInstances } from '@utils/slices/instancesSlice' | import { getInstanceActive, getInstances } from '@utils/slices/instancesSlice' | ||||||
| import { useTheme } from '@utils/styles/ThemeManager' | import { useTheme } from '@utils/styles/ThemeManager' | ||||||
| import { themes } from '@utils/styles/themes' | import { themes } from '@utils/styles/themes' | ||||||
| import * as Analytics from 'expo-firebase-analytics' |  | ||||||
| import * as Linking from 'expo-linking' | import * as Linking from 'expo-linking' | ||||||
| import { addScreenshotListener } from 'expo-screen-capture' | import { addScreenshotListener } from 'expo-screen-capture' | ||||||
| import React, { useCallback, useEffect, useRef, useState } from 'react' | import React, { useCallback, useEffect, useRef, useState } from 'react' | ||||||
| @@ -118,7 +118,7 @@ const Screens: React.FC<Props> = ({ localCorrupt }) => { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     if (previousRoute?.name !== currentRoute?.name) { |     if (previousRoute?.name !== currentRoute?.name) { | ||||||
|       Analytics.logEvent('screen_view', { screen_name: currentRoute?.name }) |       analytics('screen_view', { screen_name: currentRoute?.name }) | ||||||
|       Sentry.Native.setContext('page', { |       Sentry.Native.setContext('page', { | ||||||
|         previous: previousRoute, |         previous: previousRoute, | ||||||
|         current: currentRoute |         current: currentRoute | ||||||
|   | |||||||
| @@ -58,14 +58,14 @@ const apiGeneral = async <T = unknown>({ | |||||||
|       }) |       }) | ||||||
|     }) |     }) | ||||||
|     .catch(error => { |     .catch(error => { | ||||||
|       if (sentry && Math.random() < 0.01) { |       // if (sentry && Math.random() < 0.01) { | ||||||
|         Sentry.Native.setExtras({ |       //   Sentry.Native.setExtras({ | ||||||
|           API: 'general', |       //     API: 'general', | ||||||
|           ...(error.response && { response: error.response }), |       //     ...(error.response && { response: error.response }), | ||||||
|           ...(error.request && { request: error.request }) |       //     ...(error.request && { request: error.request }) | ||||||
|         }) |       //   }) | ||||||
|         Sentry.Native.captureException(error) |       //   Sentry.Native.captureException(error) | ||||||
|       } |       // } | ||||||
|  |  | ||||||
|       if (error.response) { |       if (error.response) { | ||||||
|         // The request was made and the server responded with a status code |         // The request was made and the server responded with a status code | ||||||
|   | |||||||
| @@ -98,14 +98,14 @@ const apiInstance = async <T = unknown>({ | |||||||
|       }) |       }) | ||||||
|     }) |     }) | ||||||
|     .catch(error => { |     .catch(error => { | ||||||
|       if (Math.random() < 0.001) { |       // if (Math.random() < 0.001) { | ||||||
|         Sentry.Native.setExtras({ |       //   Sentry.Native.setExtras({ | ||||||
|           API: 'instance', |       //     API: 'instance', | ||||||
|           ...(error.response && { response: error.response }), |       //     ...(error.response && { response: error.response }), | ||||||
|           ...(error.request && { request: error.request }) |       //     ...(error.request && { request: error.request }) | ||||||
|         }) |       //   }) | ||||||
|         Sentry.Native.captureException(error) |       //   Sentry.Native.captureException(error) | ||||||
|       } |       // } | ||||||
|  |  | ||||||
|       if (error.response) { |       if (error.response) { | ||||||
|         // The request was made and the server responded with a status code |         // The request was made and the server responded with a status code | ||||||
|   | |||||||
| @@ -41,7 +41,7 @@ export const shouldFilter = ({ | |||||||
| }) => { | }) => { | ||||||
|   const instance = getInstance(store.getState()) |   const instance = getInstance(store.getState()) | ||||||
|   const ownAccount = |   const ownAccount = | ||||||
|     getInstanceAccount(store.getState())?.id === status.account.id |     getInstanceAccount(store.getState())?.id === status.account?.id | ||||||
|  |  | ||||||
|   let shouldFilter = false |   let shouldFilter = false | ||||||
|   if (!ownAccount) { |   if (!ownAccount) { | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| import * as Analytics from 'expo-firebase-analytics' | import * as Analytics from 'expo-firebase-analytics' | ||||||
|  |  | ||||||
| const analytics = (event: string, params?: { [key: string]: any }) => { | const analytics = (event: string, params?: { [key: string]: any }) => { | ||||||
|   Analytics.logEvent(event, params) |   Analytics.logEvent(event, params).catch(() => {}) | ||||||
| } | } | ||||||
|  |  | ||||||
| export default analytics | export default analytics | ||||||
|   | |||||||
| @@ -91,8 +91,10 @@ const AccountAttachments = React.memo( | |||||||
|           return ( |           return ( | ||||||
|             <GracefullyImage |             <GracefullyImage | ||||||
|               uri={{ |               uri={{ | ||||||
|                 original: item.media_attachments[0].preview_url, |                 original: | ||||||
|                 remote: item.media_attachments[0].remote_url |                   item.media_attachments[0]?.preview_url || | ||||||
|  |                   item.media_attachments[0]?.url, | ||||||
|  |                 remote: item.media_attachments[0]?.remote_url | ||||||
|               }} |               }} | ||||||
|               blurhash={item.media_attachments[0].blurhash} |               blurhash={item.media_attachments[0].blurhash} | ||||||
|               dimension={{ width: width, height: width }} |               dimension={{ width: width, height: width }} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user