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