diff options
| author | かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> | 2023-11-27 17:33:42 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-27 17:33:42 +0900 |
| commit | 2a451ebb572531f5dfa34a3f863e2b15d29e7355 (patch) | |
| tree | 641ac9066edb00618d6e727770fd2073d974cae2 /packages/frontend/src/store.ts | |
| parent | style: fix lint error of 6acaded8 (#12476) (diff) | |
| download | misskey-2a451ebb572531f5dfa34a3f863e2b15d29e7355.tar.gz misskey-2a451ebb572531f5dfa34a3f863e2b15d29e7355.tar.bz2 misskey-2a451ebb572531f5dfa34a3f863e2b15d29e7355.zip | |
enhance(frontend): 通知音にドライブのファイルを使用できるように (#12447)
* (enhance) サウンドにドライブのファイルを使用できるように
* Update Changelog
* fix
* fix design
* fix design
* Update store.ts
* (fix) ファイル名表示
* refactor
* (refactor) better types
* operationTypeとsoundTypeの混同を防止
* (refactor)
* (fix)
* enhance jsdoc
* driveFile -> _driveFile_
Diffstat (limited to 'packages/frontend/src/store.ts')
| -rw-r--r-- | packages/frontend/src/store.ts | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 40fb1dde76..70d2cf402d 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -6,6 +6,7 @@ import { markRaw, ref } from 'vue'; import * as Misskey from 'misskey-js'; import { miLocalStorage } from './local-storage.js'; +import type { SoundType } from '@/scripts/sound.js'; import { Storage } from '@/pizzax.js'; interface PostFormAction { @@ -35,6 +36,22 @@ interface PageViewInterruptor { handler: (page: Misskey.entities.Page) => unknown; } +/** サウンド設定 */ +export type SoundStore = { + type: Exclude<SoundType, '_driveFile_'>; + volume: number; +} | { + type: '_driveFile_'; + + /** ドライブのファイルID */ + fileId: string; + + /** ファイルURL(こちらが優先される) */ + fileUrl: string; + + volume: number; +} + export const postFormActions: PostFormAction[] = []; export const userActions: UserAction[] = []; export const noteActions: NoteAction[] = []; @@ -401,27 +418,27 @@ export const defaultStore = markRaw(new Storage('base', { }, sound_note: { where: 'device', - default: { type: 'syuilo/n-aec', volume: 1 }, + default: { type: 'syuilo/n-aec', volume: 1 } as SoundStore, }, sound_noteMy: { where: 'device', - default: { type: 'syuilo/n-cea-4va', volume: 1 }, + default: { type: 'syuilo/n-cea-4va', volume: 1 } as SoundStore, }, sound_notification: { where: 'device', - default: { type: 'syuilo/n-ea', volume: 1 }, + default: { type: 'syuilo/n-ea', volume: 1 } as SoundStore, }, sound_antenna: { where: 'device', - default: { type: 'syuilo/triple', volume: 1 }, + default: { type: 'syuilo/triple', volume: 1 } as SoundStore, }, sound_channel: { where: 'device', - default: { type: 'syuilo/square-pico', volume: 1 }, + default: { type: 'syuilo/square-pico', volume: 1 } as SoundStore, }, sound_reaction: { where: 'device', - default: { type: 'syuilo/bubble2', volume: 1 }, + default: { type: 'syuilo/bubble2', volume: 1 } as SoundStore, }, })); |