mirror of
https://github.com/tooot-app/app
synced 2025-02-07 15:38:47 +01:00
Minor fixes according to DeepScan
This commit is contained in:
parent
f127fc3a1a
commit
e1e4aace78
@ -47,7 +47,10 @@ const App: React.FC = () => {
|
||||
})
|
||||
|
||||
return () => {
|
||||
AppState.removeEventListener('change', () => {})
|
||||
AppState.removeEventListener('change', () => {
|
||||
Notifications.setBadgeCountAsync(0)
|
||||
Notifications.dismissAllNotificationsAsync()
|
||||
})
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
@ -42,17 +42,17 @@ const ComposeEditAttachmentImage: React.FC<Props> = ({ index, focus }) => {
|
||||
width: imageWidthBase,
|
||||
height:
|
||||
imageWidthBase /
|
||||
((theAttachmentRemote as Mastodon.AttachmentImage).meta?.original
|
||||
((theAttachmentRemote as Mastodon.AttachmentImage)?.meta?.original
|
||||
?.aspect || 1)
|
||||
}
|
||||
|
||||
const panX = useSharedValue(
|
||||
(((theAttachmentRemote as Mastodon.AttachmentImage).meta?.focus?.x || 0) *
|
||||
(((theAttachmentRemote as Mastodon.AttachmentImage)?.meta?.focus?.x || 0) *
|
||||
imageDimensionis.width) /
|
||||
2
|
||||
)
|
||||
const panY = useSharedValue(
|
||||
(((theAttachmentRemote as Mastodon.AttachmentImage).meta?.focus?.y || 0) *
|
||||
(((theAttachmentRemote as Mastodon.AttachmentImage)?.meta?.focus?.y || 0) *
|
||||
imageDimensionis.height) /
|
||||
2
|
||||
)
|
||||
|
@ -19,8 +19,8 @@ const prefetchEmojis = (
|
||||
sortedEmojis: { title: string; data: Mastodon.Emoji[] }[]
|
||||
) => {
|
||||
let requestedIndex = 0
|
||||
sortedEmojis.map(sorted => {
|
||||
sorted.data.map(emoji => {
|
||||
sortedEmojis.forEach(sorted => {
|
||||
sorted.data.forEach(emoji => {
|
||||
if (requestedIndex > 40) {
|
||||
return
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import analytics from '@components/analytics'
|
||||
import haptics from '@components/haptics'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import React, { useCallback, useContext, useEffect, useMemo } from 'react'
|
||||
import React, { useCallback, useContext, useMemo } from 'react'
|
||||
import {
|
||||
Image,
|
||||
Pressable,
|
||||
|
@ -32,7 +32,7 @@ const ScreenMeSettingsPush: React.FC = () => {
|
||||
checkPush()
|
||||
AppState.addEventListener('change', () => checkPush())
|
||||
return () => {
|
||||
AppState.removeEventListener('change', () => {})
|
||||
AppState.removeEventListener('change', () => checkPush())
|
||||
}
|
||||
}, [])
|
||||
|
||||
@ -59,7 +59,7 @@ const ScreenMeSettingsPush: React.FC = () => {
|
||||
updateInstancePushAlert({
|
||||
changed: alert,
|
||||
alerts: {
|
||||
...instancePush.alerts,
|
||||
...instancePush?.alerts,
|
||||
[alert]: {
|
||||
...instancePush?.alerts[alert],
|
||||
value: !instancePush?.alerts[alert].value
|
||||
|
@ -13,13 +13,7 @@ import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import React from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import {
|
||||
KeyboardAvoidingView,
|
||||
Platform,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View
|
||||
} from 'react-native'
|
||||
import { StyleSheet, Text, View } from 'react-native'
|
||||
import { ScrollView } from 'react-native-gesture-handler'
|
||||
import { useQueryClient } from 'react-query'
|
||||
import { useDispatch, useSelector } from 'react-redux'
|
||||
|
@ -7,14 +7,12 @@ import React, { useCallback, useMemo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Platform } from 'react-native'
|
||||
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
||||
import { useDispatch } from 'react-redux'
|
||||
|
||||
const Stack = createNativeStackNavigator<Nav.TabNotificationsStackParamList>()
|
||||
|
||||
const TabNotifications = React.memo(
|
||||
() => {
|
||||
const { t } = useTranslation()
|
||||
const dispatch = useDispatch()
|
||||
|
||||
const screenOptions = useMemo(
|
||||
() => ({
|
||||
|
@ -1,12 +1,8 @@
|
||||
import { createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit'
|
||||
import i18n from '@root/i18n/i18n'
|
||||
import { RootState, store } from '@root/store'
|
||||
import { RootState } from '@root/store'
|
||||
import * as Analytics from 'expo-firebase-analytics'
|
||||
import * as Localization from 'expo-localization'
|
||||
import * as Notifications from 'expo-notifications'
|
||||
import { pickBy } from 'lodash'
|
||||
import androidDefaults from './instances/push/androidDefaults'
|
||||
import { getInstances } from './instancesSlice'
|
||||
|
||||
enum availableLanguages {
|
||||
'zh-Hans',
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { Dimensions } from 'react-native'
|
||||
|
||||
const { width, height } = Dimensions.get('screen')
|
||||
const { width } = Dimensions.get('screen')
|
||||
|
||||
const guidelineBaseWidth = 375
|
||||
const guidelineBaseHeight = 667
|
||||
// const guidelineBaseHeight = 667
|
||||
|
||||
const scale = (size: number) => (width / guidelineBaseWidth) * size
|
||||
const verticalScale = (size: number) => (height / guidelineBaseHeight) * size
|
||||
// const verticalScale = (size: number) => (height / guidelineBaseHeight) * size
|
||||
const moderateScale = (size: number, factor = 0.5) =>
|
||||
size + (scale(size) - size) * factor
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user