mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Remove comma from hell and improve useRingtoneSound (#127)
This commit is contained in:
1 parent
4eda44b9c2
commit
e9e22ce9bc
4 files changed
+26
-53
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useContext, useEffect, useMemo } from 'react';
|
||||
import { useContext, useEffect, useMemo } from 'react';
|
||||
import { useSettings } from '../../../apps/settings/hooks/useSettings';
|
||||
import { soundContext } from '../providers/SoundProvider';
|
||||
import { getSoundSettings } from '../utils/getSoundSettings';
|
||||
@@ -24,24 +24,9 @@ export const useRingtoneSound = () => {
|
||||
context.volume(options.sound, options.volume);
|
||||
}, [context, options.sound, options.volume]);
|
||||
|
||||
const play = useCallback(() => {
|
||||
context.play(options.sound, options.volume, true);
|
||||
}, [context, options.sound, options.volume]);
|
||||
|
||||
const stop = useCallback(() => {
|
||||
context.stop(options.sound);
|
||||
}, [context, options.sound]);
|
||||
|
||||
const playing = useCallback(() => {
|
||||
return context.playing(options.sound);
|
||||
}, [context, options.sound]);
|
||||
|
||||
return useMemo(
|
||||
() => ({
|
||||
play,
|
||||
stop,
|
||||
playing,
|
||||
}),
|
||||
[play, playing, stop]
|
||||
);
|
||||
return {
|
||||
play: () => context.play(options.sound, options.volume, true),
|
||||
stop: () => context.stop(options.sound),
|
||||
playing: () => context.playing(options.sound),
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user