From b0fd1a2cd6aeaee5f758f714875ff77afa2ae7e9 Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Thu, 7 Mar 2024 12:31:05 -0800 Subject: [PATCH] added notes lable translation --- net/web/src/constants/Strings.js | 12 +++++++++--- net/web/src/context/useRingContext.hook.js | 4 ++-- net/web/src/session/Session.jsx | 8 +++++--- net/web/src/session/channels/useChannels.hook.js | 2 +- .../channelHeader/useChannelHeader.hook.js | 8 +++++--- net/web/src/session/details/useDetails.hook.js | 4 ++-- todo | 9 ++------- 7 files changed, 26 insertions(+), 21 deletions(-) diff --git a/net/web/src/constants/Strings.js b/net/web/src/constants/Strings.js index e740f3c0..a368ea8d 100644 --- a/net/web/src/constants/Strings.js +++ b/net/web/src/constants/Strings.js @@ -176,7 +176,9 @@ export const en = { integrated: 'Integrated', microphone: 'Microphone', - camera: 'Camera' + camera: 'Camera', + + notes: 'Notes', }; export const fr = { @@ -357,7 +359,9 @@ export const fr = { integrated: 'Intégré', microphone: 'Microphone', - camera: 'Caméra' + camera: 'Caméra', + + notes: 'Notes', }; export const sp = { @@ -538,5 +542,7 @@ export const sp = { integrated: 'Integrado', microphone: 'Micrófono', - camera: 'Cámara' + camera: 'Cámara', + + notes: 'Notas', } diff --git a/net/web/src/context/useRingContext.hook.js b/net/web/src/context/useRingContext.hook.js index 4ceac9ea..2e2b1960 100644 --- a/net/web/src/context/useRingContext.hook.js +++ b/net/web/src/context/useRingContext.hook.js @@ -271,7 +271,7 @@ export function useRingContext() { audioTrack.current.stop(); audioTrack.current = null; } - updateState({ callStatus: null }); + updateState({ callStatus: null, remoteVideo: false, remoteAudio: false }); } ws.current.onopen = async () => { ws.current.send(JSON.stringify({ AppToken: token })); @@ -394,7 +394,7 @@ export function useRingContext() { } catch (err) { calling.current = null; - updateState({ callStatus: null }); + updateState({ callStatus: null, remoteVideo: false, remoteAudio: false }); } let index = 0; diff --git a/net/web/src/session/Session.jsx b/net/web/src/session/Session.jsx index 34472089..a7808c0e 100644 --- a/net/web/src/session/Session.jsx +++ b/net/web/src/session/Session.jsx @@ -36,6 +36,11 @@ export function Session() { const remote = useRef(); const local = useRef(); + useEffect(() => { + console.log(">> ", state.remoteVideo); + }, [state.remoteVideo]); + + useEffect(() => { let incoming = []; for (let i = 0; i < state.ringing.length; i++) { @@ -71,9 +76,6 @@ export function Session() { remote.current.load(); remote.current.play(); } - else { - console.log("video player not set"); - } }, [state.remoteStream]); useEffect(() => { diff --git a/net/web/src/session/channels/useChannels.hook.js b/net/web/src/session/channels/useChannels.hook.js index b83043a9..f0ab01f7 100644 --- a/net/web/src/session/channels/useChannels.hook.js +++ b/net/web/src/session/channels/useChannels.hook.js @@ -78,7 +78,7 @@ export function useChannels() { // set logo and label if (memberCount === 0) { item.img = 'solution'; - item.label = 'Notes'; + item.label = state.strings.notes; } else if (memberCount === 1) { item.logo = logo; diff --git a/net/web/src/session/conversation/channelHeader/useChannelHeader.hook.js b/net/web/src/session/conversation/channelHeader/useChannelHeader.hook.js index 82df040e..01c4004b 100644 --- a/net/web/src/session/conversation/channelHeader/useChannelHeader.hook.js +++ b/net/web/src/session/conversation/channelHeader/useChannelHeader.hook.js @@ -15,6 +15,7 @@ export function useChannelHeader(contentKey) { title: null, offsync: false, display: null, + strings: {}, }); const settings = useContext(SettingsContext); @@ -32,7 +33,8 @@ export function useChannelHeader(contentKey) { } useEffect(() => { - updateState({ display: settings.state.display }); + const { display, strings } = settings.state; + updateState({ display, strings }); }, [settings.state]); useEffect(() => { @@ -84,7 +86,7 @@ export function useChannelHeader(contentKey) { let label; if (memberCount === 0) { img = 'solution'; - label = 'Notes'; + label = state.strings.notes; } else if (memberCount === 1) { label = names.join(','); @@ -126,7 +128,7 @@ export function useChannelHeader(contentKey) { updateState({ label, img, logo }); } // eslint-disable-next-line - }, [conversation.state, card.state, contentKey]); + }, [conversation.state, card.state, state.strings, contentKey]); const actions = { resync: () => { diff --git a/net/web/src/session/details/useDetails.hook.js b/net/web/src/session/details/useDetails.hook.js index 7b90f5e7..c3472275 100644 --- a/net/web/src/session/details/useDetails.hook.js +++ b/net/web/src/session/details/useDetails.hook.js @@ -165,7 +165,7 @@ export function useDetails() { let label; if (memberCount === 0) { img = 'solution'; - label = 'Notes'; + label = state.strings.notes; } else if (memberCount === 1) { label = names.join(','); @@ -209,7 +209,7 @@ export function useDetails() { editMembers: new Set(members) }); } // eslint-disable-next-line - }, [conversation.state, card.state, state.contentKey]); + }, [conversation.state, card.state, state.strings, state.contentKey]); const actions = { setEditSubject: () => { diff --git a/todo b/todo index a0d27aa0..c056775c 100644 --- a/todo +++ b/todo @@ -1,15 +1,10 @@ -calling: - - dark style - - translation - - layout - - fullscreen - - device selection add languages: -spanish portugues german russian +fix lint warnings + trim docker image