-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Merge 4.45.0 into master (#5482)
- Loading branch information
Showing
52 changed files
with
428 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,34 @@ | ||
import { Audio } from 'expo-av'; | ||
import React, { useEffect, useRef } from 'react'; | ||
import { View } from 'react-native'; | ||
|
||
export enum ERingerSounds { | ||
DIALTONE = 'dialtone', | ||
RINGTONE = 'ringtone' | ||
} | ||
|
||
const Ringer = React.memo(({ ringer }: { ringer: ERingerSounds }) => { | ||
const sound = useRef<Audio.Sound | null>(null); | ||
const sound = useRef(new Audio.Sound()); | ||
|
||
useEffect(() => { | ||
(async () => { | ||
let expo = null; | ||
switch (ringer) { | ||
case ERingerSounds.DIALTONE: | ||
expo = await Audio.Sound.createAsync(require(`./dialtone.mp3`)); | ||
break; | ||
case ERingerSounds.RINGTONE: | ||
expo = await Audio.Sound.createAsync(require(`./ringtone.mp3`)); | ||
break; | ||
default: | ||
expo = await Audio.Sound.createAsync(require(`./dialtone.mp3`)); | ||
break; | ||
const loadAndPlay = async () => { | ||
try { | ||
const soundFile = ringer === ERingerSounds.DIALTONE ? require(`./dialtone.mp3`) : require(`./ringtone.mp3`); | ||
await sound.current.loadAsync(soundFile); | ||
await sound.current.playAsync(); | ||
await sound.current.setIsLoopingAsync(true); | ||
} catch (error) { | ||
console.error('Error loading sound:', error); | ||
} | ||
sound.current = expo.sound; | ||
await sound.current.playAsync(); | ||
await sound.current.setIsLoopingAsync(true); | ||
})(); | ||
}, []); | ||
}; | ||
|
||
useEffect(() => () => stopSound(), []); | ||
loadAndPlay(); | ||
|
||
const stopSound = () => { | ||
sound?.current?.unloadAsync(); | ||
}; | ||
return () => { | ||
sound.current?.unloadAsync(); | ||
}; | ||
}, []); | ||
|
||
return <View />; | ||
return null; | ||
}); | ||
|
||
export default Ringer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type ModerationEndpoints = { | ||
'moderation.reportUser': { | ||
POST: (params: { userId: string; description: string }) => void; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.