Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: actions/setup-node@v6
with:
node-version: '18.x'
node-version: '22.x'

- uses: actions/cache@v5
with:
Expand Down
26 changes: 11 additions & 15 deletions app/assistant/ui/ControlBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TrackReference, useLocalParticipant } from '@livekit/components-react';
import { BarVisualizer } from '@livekit/react-native';
import { useEffect, useState } from 'react';
import { useMemo } from 'react';
import {
ViewStyle,
StyleSheet,
Expand Down Expand Up @@ -29,22 +29,18 @@ type ControlBarOptions = {

export default function ControlBar({ style = {}, options }: ControlBarProps) {
const { microphoneTrack, localParticipant } = useLocalParticipant();
const [trackRef, setTrackRef] = useState<TrackReference | undefined>(
undefined
const trackRef = useMemo<TrackReference | undefined>(
() =>
microphoneTrack
? {
participant: localParticipant,
publication: microphoneTrack,
source: microphoneTrack.source,
}
: undefined,
[microphoneTrack, localParticipant]
);

useEffect(() => {
if (microphoneTrack) {
setTrackRef({
participant: localParticipant,
publication: microphoneTrack,
source: microphoneTrack.source,
});
} else {
setTrackRef(undefined);
}
}, [microphoneTrack, localParticipant]);

// Images
let micImage = options.isMicEnabled
? require('@/assets/images/mic_24dp.png')
Expand Down
3 changes: 2 additions & 1 deletion hooks/useThemeColor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export function useThemeColor(
props: { light?: string; dark?: string },
colorName: keyof typeof Colors.light & keyof typeof Colors.dark
) {
const theme = useColorScheme() ?? 'light';
// ColorSchemeName can also be null or 'unspecified'; treat everything but 'dark' as light.
const theme = useColorScheme() === 'dark' ? 'dark' : 'light';
const colorFromProps = props[theme];

if (colorFromProps) {
Expand Down
Loading
Loading