Skip to content

Commit 45f3ef2

Browse files
committed
fix(voip): fold controlsVisible into set() calls, update snapshots, remove progress doc
Merge controlsVisible: true into existing Zustand set() calls instead of separate showControls() to avoid double renders. Update stale MediaCallHeader snapshots and remove planning doc from repo.
1 parent 092ef85 commit 45f3ef2

File tree

3 files changed

+16
-129
lines changed

3 files changed

+16
-129
lines changed

app/containers/MediaCallHeader/__snapshots__/MediaCallHeader.test.tsx.snap

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ exports[`Story Snapshots: ActiveCall should match snapshot 1`] = `
2626
"paddingTop": 12,
2727
},
2828
{
29+
"backgroundColor": "#E4E7EA",
30+
"borderBottomColor": "#CBCED1",
2931
"opacity": 1,
3032
"transform": [
3133
{
@@ -382,6 +384,8 @@ exports[`Story Snapshots: Collapsed should match snapshot 1`] = `
382384
"paddingTop": 12,
383385
},
384386
{
387+
"backgroundColor": "#E4E7EA",
388+
"borderBottomColor": "#CBCED1",
385389
"opacity": 1,
386390
"transform": [
387391
{
@@ -738,6 +742,8 @@ exports[`Story Snapshots: ConnectingCall should match snapshot 1`] = `
738742
"paddingTop": 12,
739743
},
740744
{
745+
"backgroundColor": "#E4E7EA",
746+
"borderBottomColor": "#CBCED1",
741747
"opacity": 1,
742748
"transform": [
743749
{
@@ -1090,6 +1096,8 @@ exports[`Story Snapshots: Focused should match snapshot 1`] = `
10901096
"paddingTop": 12,
10911097
},
10921098
{
1099+
"backgroundColor": "#E4E7EA",
1100+
"borderBottomColor": "#CBCED1",
10931101
"opacity": 1,
10941102
"transform": [
10951103
{
@@ -1466,6 +1474,8 @@ exports[`Story Snapshots: WithRemoteHeld should match snapshot 1`] = `
14661474
"paddingTop": 12,
14671475
},
14681476
{
1477+
"backgroundColor": "#E4E7EA",
1478+
"borderBottomColor": "#CBCED1",
14691479
"opacity": 1,
14701480
"transform": [
14711481
{
@@ -1822,6 +1832,8 @@ exports[`Story Snapshots: WithRemoteMuted should match snapshot 1`] = `
18221832
"paddingTop": 12,
18231833
},
18241834
{
1835+
"backgroundColor": "#E4E7EA",
1836+
"borderBottomColor": "#CBCED1",
18251837
"opacity": 1,
18261838
"transform": [
18271839
{

app/lib/services/voip/useCallStore.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ export const useCallStore = create<CallStore>((set, get) => ({
163163
if (!currentCall) return;
164164

165165
const newState = currentCall.state;
166-
set({ callState: newState });
167-
get().showControls();
166+
set({ callState: newState, controlsVisible: true });
168167

169168
// Set start time when call becomes active
170169
if (newState === 'active' && !get().callStartTime) {
@@ -180,9 +179,9 @@ export const useCallStore = create<CallStore>((set, get) => ({
180179
isMuted: currentCall.muted,
181180
isOnHold: currentCall.held,
182181
remoteMute: currentCall.remoteMute,
183-
remoteHeld: currentCall.remoteHeld
182+
remoteHeld: currentCall.remoteHeld,
183+
controlsVisible: true
184184
});
185-
get().showControls();
186185
};
187186

188187
const handleEnded = () => {
@@ -242,8 +241,7 @@ export const useCallStore = create<CallStore>((set, get) => ({
242241

243242
toggleFocus: () => {
244243
const isFocused = get().focused;
245-
set({ focused: !isFocused });
246-
get().showControls();
244+
set({ focused: !isFocused, controlsVisible: true });
247245
if (isFocused) {
248246
Navigation.back();
249247
} else {

progress-controls-animation.md

Lines changed: 0 additions & 123 deletions
This file was deleted.

0 commit comments

Comments
 (0)