サウンド設定でドライブのファイルを利用可否をロールで制御可能に(デフォルトでオフ)

This commit is contained in:
まっちゃとーにゅ 2023-12-27 10:16:48 +09:00
parent 98f4b69418
commit 90e8b942a3
No known key found for this signature in database
GPG key ID: 143DE582A97FE052
12 changed files with 53 additions and 5 deletions

View file

@ -5,6 +5,7 @@
import type { SoundStore } from '@/store.js';
import { defaultStore } from '@/store.js';
import { $i } from "@/account.js";
import * as os from '@/os.js';
let ctx: AudioContext;
@ -16,7 +17,7 @@ export const soundsTypes = [
null,
// ドライブの音声
'_driveFile_',
...($i?.policies.canUseDriveFileInSoundSettings ? ['_driveFile_'] : []),
// プリインストール
'syuilo/n-aec',
@ -156,7 +157,7 @@ export type OperationType = typeof operationTypes[number];
export async function loadAudio(soundStore: SoundStore, options?: { useCache?: boolean; }) {
if (_DEV_) console.log('loading audio. opts:', options);
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (soundStore.type === null || (soundStore.type === '_driveFile_' && !soundStore.fileUrl)) {
if (soundStore.type === null || (soundStore.type === '_driveFile_' && (!$i?.policies.canUseDriveFileInSoundSettings || !soundStore.fileUrl))) {
return;
}
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition