wip
This commit is contained in:
@@ -21,7 +21,7 @@ import { applyTheme, lightTheme } from '@/scripts/theme';
|
|||||||
import { isDeviceDarkmode } from '@/scripts/is-device-darkmode';
|
import { isDeviceDarkmode } from '@/scripts/is-device-darkmode';
|
||||||
import { createPluginEnv } from '@/scripts/aiscript/api';
|
import { createPluginEnv } from '@/scripts/aiscript/api';
|
||||||
import { i18n, lang } from './i18n';
|
import { i18n, lang } from './i18n';
|
||||||
import { stream } from '@/os';
|
import { stream, sound } from '@/os';
|
||||||
|
|
||||||
console.info(`Misskey v${version}`);
|
console.info(`Misskey v${version}`);
|
||||||
|
|
||||||
@@ -292,7 +292,7 @@ if (store.getters.isSignedIn) {
|
|||||||
hasUnreadMessagingMessage: true
|
hasUnreadMessagingMessage: true
|
||||||
});
|
});
|
||||||
|
|
||||||
app.sound('chatBg');
|
sound('chatBg');
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllAntennas', () => {
|
main.on('readAllAntennas', () => {
|
||||||
@@ -306,7 +306,7 @@ if (store.getters.isSignedIn) {
|
|||||||
hasUnreadAntenna: true
|
hasUnreadAntenna: true
|
||||||
});
|
});
|
||||||
|
|
||||||
app.sound('antenna');
|
sound('antenna');
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllAnnouncements', () => {
|
main.on('readAllAnnouncements', () => {
|
||||||
@@ -326,7 +326,7 @@ if (store.getters.isSignedIn) {
|
|||||||
hasUnreadChannel: true
|
hasUnreadChannel: true
|
||||||
});
|
});
|
||||||
|
|
||||||
app.sound('channel');
|
sound('channel');
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllAnnouncements', () => {
|
main.on('readAllAnnouncements', () => {
|
||||||
|
@@ -56,3 +56,12 @@ export function menu(props: Record<string, any>) {
|
|||||||
props
|
props
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function sound(type: string) {
|
||||||
|
if (store.state.device.sfxVolume === 0) return;
|
||||||
|
const sound = store.state.device['sfx' + type.substr(0, 1).toUpperCase() + type.substr(1)];
|
||||||
|
if (sound == null) return;
|
||||||
|
const audio = new Audio(`/assets/sounds/${sound}.mp3`);
|
||||||
|
audio.volume = store.state.device.sfxVolume;
|
||||||
|
audio.play();
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user