Merge remote-tracking branch 'misskey-dev/develop' into io

This commit is contained in:
まっちゃとーにゅ 2024-01-12 06:08:08 +09:00
commit 4ae637fba0
No known key found for this signature in database
GPG key ID: 143DE582A97FE052
25 changed files with 1951 additions and 1212 deletions

View file

@ -154,14 +154,12 @@ export type OperationType = typeof operationTypes[number];
* @param options `useCache`: `true`
*/
export async function loadAudio(url: string, options?: { useCache?: boolean; }) {
if (_DEV_) console.log('loading audio. opts:', options);
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (ctx == null) {
ctx = new AudioContext();
}
if (options?.useCache ?? true) {
if (cache.has(url)) {
if (_DEV_) console.log('use cache');
return cache.get(url) as AudioBuffer;
}
}
@ -190,7 +188,6 @@ export async function loadAudio(url: string, options?: { useCache?: boolean; })
*/
export function playMisskeySfx(operationType: OperationType) {
const sound = defaultStore.state[`sound_${operationType}`];
if (_DEV_) console.log('play', operationType, sound);
if (sound.type == null || !canPlay) return;
canPlay = false;