diff --git a/app/mobile/src/constants/Strings.js b/app/mobile/src/constants/Strings.js index 9b7dc420..18b48531 100644 --- a/app/mobile/src/constants/Strings.js +++ b/app/mobile/src/constants/Strings.js @@ -158,6 +158,7 @@ const Strings = [ enableImage: 'Enable Image Queue', enableAudio: 'Enable Audio Queue', enableVideo: 'Enable Video Queue', + enableBinary: 'Enable Binary Files', enableCalls: 'Enable WebRTC Calls', relayUrl: 'Relay URL', relayUsername: 'Relay Username', @@ -356,6 +357,7 @@ const Strings = [ enableImage: 'Activer les Fichiers Image', enableAudio: 'Activer les Fichiers Audio', enableVideo: 'Activer les Fichiers Vidéo', + enableBinary: 'Activer les Fichiers Binaires', enableCalls: 'Activer les Appels', relayUrl: 'URL de Relais', relayUsername: 'Nom d\'Utilisateur du Relais', @@ -554,6 +556,7 @@ const Strings = [ enableImage: 'Permitir Archivos de Imagen', enableAudio: 'Permitir Archivos de Audio', enableVideo: 'Permitir Archivos de Vídeo', + enableBinary: 'Permitir Archivos Binarios', enableCalls: 'Permitier Llamadas', relayUrl: 'URL para Llamadas', relayUsername: 'Nombre de Usuario para Llamadas', @@ -753,6 +756,7 @@ const Strings = [ enableImage: 'Bilddateien Aktivieren', enableAudio: 'Audiodateien Aktivieren', enableVideo: 'Videodateien aktivieren', + enableBinary: 'Binärdateien aktivieren', enableCalls: 'Anrufe Ermöglichen', relayUrl: 'URL für Anrufe', relayUsername: 'Benutzername für Anrufe', @@ -940,6 +944,7 @@ const Strings = [ enableImage: 'Habilitar Fila de Imagens', enableAudio: 'Habilitar Fila de Áudio', enableVideo: 'Habilitar Fila de Vídeo', + enableBinary: 'Habilitar Fila Binários', enableCalls: 'Habilitar Chamadas WebRTC', relayUrl: 'URL do Relay', relayUsername: 'Nome de Usuário do Relay', @@ -1124,6 +1129,7 @@ const Strings = [ enableImage: 'Включить очередь изображений', enableAudio: 'Включить очередь аудио', enableVideo: 'Включить очередь видео', + enableBinary: 'Включить двоичные файлы', enableCalls: 'Включить звонки WebRTC', relayUrl: 'URL релея', relayUsername: 'Имя пользователя релея', diff --git a/app/mobile/src/dashboard/Dashboard.jsx b/app/mobile/src/dashboard/Dashboard.jsx index dd5971bc..88b58047 100644 --- a/app/mobile/src/dashboard/Dashboard.jsx +++ b/app/mobile/src/dashboard/Dashboard.jsx @@ -220,6 +220,12 @@ export function Dashboard(props) { + actions.setEnableBinary(!state.enableBinary)}> + { state.strings.enableBinary } + + { - const { keyType, accountStorage, domain, enableImage, enableAudio, enableVideo, transformSupported, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword } = config; + const { keyType, accountStorage, domain, enableImage, enableAudio, enableVideo, enableBinary, transformSupported, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword } = config; const storage = Math.ceil(accountStorage / 1073741824); - updateState({ keyType, storage: storage.toString(), domain, enableImage, enableAudio, enableVideo, transformSupported, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword }); + updateState({ keyType, storage: storage.toString(), domain, enableImage, enableAudio, enableVideo, enableBinary, transformSupported, allowUnsealed, pushSupported, enableIce, iceUrl, iceUsername, icePassword }); }, [config]); useEffect(() => { @@ -124,6 +125,9 @@ export function useDashboard(config, server, token) { setEnableVideo: (enableVideo) => { updateState({ enableVideo }); }, + setEnableBinary: (enableBinary) => { + updateState({ enableBinary }); + }, setKeyType: (keyType) => { updateState({ keyType }); }, @@ -140,9 +144,9 @@ export function useDashboard(config, server, token) { updateState({ icePassword }); }, saveConfig: async () => { - const { storage, domain, keyType, enableImage, pushSupported, allowUnsealed, transformSupported, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword } = state; + const { storage, domain, keyType, enableImage, pushSupported, allowUnsealed, transformSupported, enableAudio, enableVideo, enableBinary, enableIce, iceUrl, iceUsername, icePassword } = state; const accountStorage = Number(storage) * 1073741824; - const config = { accountStorage, domain, keyType, enableImage, pushSupported, allowUnsealed, transformSupported, enableAudio, enableVideo, enableIce, iceUrl, iceUsername, icePassword }; + const config = { accountStorage, domain, keyType, enableImage, pushSupported, allowUnsealed, transformSupported, enableAudio, enableVideo, enableBinary, enableIce, iceUrl, iceUsername, icePassword }; await setNodeConfig(server, token, config); }, enableUser: async (accountId, enabled) => { diff --git a/app/mobile/src/session/conversation/addTopic/AddTopic.jsx b/app/mobile/src/session/conversation/addTopic/AddTopic.jsx index c4eb5ae0..76ca4d42 100644 --- a/app/mobile/src/session/conversation/addTopic/AddTopic.jsx +++ b/app/mobile/src/session/conversation/addTopic/AddTopic.jsx @@ -192,9 +192,11 @@ export function AddTopic({ contentKey, shareIntent, setShareIntent }) { )} - - - + { state.enableBinary && ( + + + + )} diff --git a/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js b/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js index 50bd487f..3a01ad13 100644 --- a/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js +++ b/app/mobile/src/session/conversation/addTopic/useAddTopic.hook.js @@ -26,6 +26,7 @@ export function useAddTopic(contentKey) { enableImage: false, enableAudio: false, enableVideo: false, + enableBinary: false, locked: true, loaded: false, conflict: false, @@ -50,15 +51,18 @@ export function useAddTopic(contentKey) { if (asset.type === 'image' && !state.enableImage) { conflict = true; } - if (asset.video === 'video' && !state.enableVideo) { + if (asset.type === 'video' && !state.enableVideo) { conflict = true; } - if (asset.audio === 'audio' && !state.enableAudio) { + if (asset.type === 'audio' && !state.enableAudio) { + conflict = true; + } + if (asset.type === 'binary' && !state.enableBinary) { conflict = true; } }); updateState({ conflict }); - }, [state.assets, state.locked, state.enableImage, state.enableAudio, state.enableVideo]); + }, [state.assets, state.locked, state.enableImage, state.enableAudio, state.enableVideo, state.enableBinary]); useEffect(() => { updateState({ assets: [] }); @@ -105,10 +109,10 @@ export function useAddTopic(contentKey) { }, [upload.state, conversation.state]); useEffect(() => { - const { enableVideo, enableAudio, enableImage } = conversation.state.channel?.detail || {}; + const { enableVideo, enableAudio, enableImage, enableBinary } = conversation.state.channel?.detail || {}; const locked = conversation.state.channel?.detail?.dataType === 'superbasic' ? false : true; const loaded = conversation.state.loaded; - updateState({ enableImage, enableAudio, enableVideo, locked, loaded }); + updateState({ enableImage, enableAudio, enableVideo, enableBinary, locked, loaded }); }, [conversation.state]); const setAsset = async (file, mime, scale) => { @@ -172,9 +176,6 @@ export function useAddTopic(contentKey) { asset.type = 'binary'; asset.extension = name.split('.').pop().toUpperCase(); asset.label = name.slice(0, -1 * (asset.extension.length + 1)); - -console.log(asset); - updateState({ assets: [ ...state.assets, asset ] }); }, setVideoPosition: (key, position) => {