fix: add unmute for iOS

This commit is contained in:
MAZE 2024-01-28 15:35:09 +03:30
parent 1f635348e3
commit e422b52436
3 changed files with 26 additions and 0 deletions

20
package-lock.json generated
View file

@ -21,6 +21,7 @@
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-icons": "4.11.0", "react-icons": "4.11.0",
"react-wrap-balancer": "1.1.0", "react-wrap-balancer": "1.1.0",
"unmute-ios-audio": "3.3.0",
"zustand": "4.4.3" "zustand": "4.4.3"
}, },
"devDependencies": { "devDependencies": {
@ -15785,6 +15786,25 @@
"node": ">= 10.0.0" "node": ">= 10.0.0"
} }
}, },
"node_modules/unmute-ios-audio": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/unmute-ios-audio/-/unmute-ios-audio-3.3.0.tgz",
"integrity": "sha512-MmoCOrsS2gn3wLT2tT+hF56Q4V4kksIKn2LHrwAtX6umzQwQHDWSh1slMzH+0WuxTZ62s3w8/wsfIII1FQ7ACg==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
},
"node_modules/untildify": { "node_modules/untildify": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz",

View file

@ -34,6 +34,7 @@
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-icons": "4.11.0", "react-icons": "4.11.0",
"react-wrap-balancer": "1.1.0", "react-wrap-balancer": "1.1.0",
"unmute-ios-audio": "3.3.0",
"zustand": "4.4.3" "zustand": "4.4.3"
}, },
"devDependencies": { "devDependencies": {

View file

@ -2,6 +2,7 @@ import { useMemo, useEffect } from 'react';
import { useShallow } from 'zustand/react/shallow'; import { useShallow } from 'zustand/react/shallow';
import { BiSolidHeart } from 'react-icons/bi/index'; import { BiSolidHeart } from 'react-icons/bi/index';
import { Howler } from 'howler'; import { Howler } from 'howler';
import unmuteAudio from 'unmute-ios-audio';
import { useSoundStore } from '@/store'; import { useSoundStore } from '@/store';
@ -53,6 +54,10 @@ export function App() {
return () => document.removeEventListener('visibilitychange', onChange); return () => document.removeEventListener('visibilitychange', onChange);
}, []); }, []);
useEffect(() => {
unmuteAudio();
}, []);
const allCategories = useMemo(() => { const allCategories = useMemo(() => {
const favorites = []; const favorites = [];