fix block send in mobile

This commit is contained in:
balzack 2023-04-27 22:49:01 -07:00
parent 1252e52dba
commit c342ed73b4
2 changed files with 5 additions and 8 deletions

View File

@ -154,22 +154,22 @@ export function AddTopic({ contentKey, shareIntent, setShareIntent }) {
blurOnSubmit={true} onSubmitEditing={sendMessage} returnKeyType="send"
autoCapitalize="sentences" placeholder="New Message" multiline={true} />
<View style={styles.addButtons}>
{ !state.locked && state.enableImage && (
{ state.enableImage && (
<TouchableOpacity style={styles.addButton} onPress={addImage}>
<AntIcons name="picture" size={20} color={Colors.text} />
</TouchableOpacity>
)}
{ !state.locked && state.enableVideo && (
{ state.enableVideo && (
<TouchableOpacity style={styles.addButton} onPress={addVideo}>
<MatIcons name="video-outline" size={24} color={Colors.text} />
</TouchableOpacity>
)}
{ !state.locked && state.enableAudio && (
{ state.enableAudio && (
<TouchableOpacity style={styles.addButton} onPress={addAudio}>
<MatIcons name="music-box-outline" size={20} color={Colors.text} />
</TouchableOpacity>
)}
{ !state.locked && (
{ (state.enableImage || state.enableVideo || state.enableAudio) && (
<View style={styles.divider} />
)}
<TouchableOpacity style={styles.addButton} onPress={actions.showFontSize}>

View File

@ -38,9 +38,6 @@ export function useAddTopic(contentKey) {
useEffect(() => {
let conflict = false;
if (state.locked && state.assets.length > 0) {
conflict = true;
}
state.assets.forEach(asset => {
if (asset.type === 'image' && !state.enableImage) {
conflict = true;
@ -114,7 +111,7 @@ export function useAddTopic(contentKey) {
return null;
}
const block = await RNFS.read(file, len, pos, 'base64');
return getEncryptedBlock(block, contentKey);
return encryptBlock(block, contentKey);
}
return { data: url, encrypted: true, size: stat.size, getEncryptedBlock };
}