Merge commit '8e0fd2d619dac93c193da6a762564244e5622498' into glitch-soc/merge-upstream

Conflicts:
- `.github/workflows/build-image.yml`:
  Upstream changed how releases are tagged, we don't have releases.
  Ignored the changes
This commit is contained in:
Claire
2023-07-12 15:54:58 +02:00
10 changed files with 292 additions and 157 deletions

View File

@@ -1,5 +1,8 @@
import type { Middleware, AnyAction } from 'redux';
import ready from 'mastodon/ready';
import { assetHost } from 'mastodon/utils/config';
import type { RootState } from '..';
interface AudioSource {
@@ -35,18 +38,20 @@ export const soundsMiddleware = (): Middleware<
Record<string, never>,
RootState
> => {
const soundCache: { [key: string]: HTMLAudioElement } = {
boop: createAudio([
const soundCache: { [key: string]: HTMLAudioElement } = {};
void ready(() => {
soundCache.boop = createAudio([
{
src: '/sounds/boop.ogg',
src: `${assetHost}/sounds/boop.ogg`,
type: 'audio/ogg',
},
{
src: '/sounds/boop.mp3',
src: `${assetHost}/sounds/boop.mp3`,
type: 'audio/mpeg',
},
]),
};
]);
});
return () =>
(next) =>