mirror of https://github.com/tooot-app/app
Fixed #37
This commit is contained in:
parent
b21194ca5a
commit
83d472bc4a
|
@ -343,8 +343,7 @@ const ScreenCompose: React.FC<ScreenComposeProp> = ({
|
|||
return (
|
||||
<KeyboardAvoidingView
|
||||
style={styles.base}
|
||||
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
||||
keyboardVerticalOffset={Platform.OS === 'android' ? 30 : 0}
|
||||
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||
>
|
||||
<SafeAreaView
|
||||
style={styles.base}
|
||||
|
|
|
@ -9,11 +9,12 @@ import {
|
|||
} from '@utils/slices/instancesSlice'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import React, { useCallback, useContext, useState } from 'react'
|
||||
import React, { useCallback, useContext, useEffect, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import {
|
||||
Dimensions,
|
||||
Modal,
|
||||
Platform,
|
||||
Pressable,
|
||||
StyleSheet,
|
||||
Text,
|
||||
|
@ -41,6 +42,12 @@ const ComposeDraftsListRoot: React.FC<Props> = ({ timestamp }) => {
|
|||
draft => draft.timestamp !== timestamp
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (instanceDrafts?.length === 0) {
|
||||
navigation.goBack()
|
||||
}
|
||||
}, [instanceDrafts?.length])
|
||||
|
||||
const actionWidth =
|
||||
StyleConstants.Font.Size.L + StyleConstants.Spacing.Global.PagePadding * 4
|
||||
|
||||
|
@ -156,18 +163,18 @@ const ComposeDraftsListRoot: React.FC<Props> = ({ timestamp }) => {
|
|||
|
||||
return (
|
||||
<>
|
||||
<PanGestureHandler enabled={true}>
|
||||
<PanGestureHandler enabled={Platform.OS === 'ios'}>
|
||||
<SwipeListView
|
||||
data={instanceDrafts}
|
||||
renderItem={renderItem}
|
||||
renderHiddenItem={renderHiddenItem}
|
||||
disableRightSwipe={true}
|
||||
rightOpenValue={-actionWidth}
|
||||
previewRowKey={
|
||||
instanceDrafts?.length
|
||||
? instanceDrafts[0].timestamp.toString()
|
||||
: undefined
|
||||
}
|
||||
// previewRowKey={
|
||||
// instanceDrafts?.length
|
||||
// ? instanceDrafts[0].timestamp.toString()
|
||||
// : undefined
|
||||
// }
|
||||
// previewDuration={350}
|
||||
previewOpenValue={-actionWidth / 2}
|
||||
ItemSeparatorComponent={ComponentSeparator}
|
||||
|
|
Loading…
Reference in New Issue