Skip to content

Commit

Permalink
コンポーネント群の修正 (#1681)
Browse files Browse the repository at this point in the history
* コンポーネント群の修正

* 残りコンポーネント修正
  • Loading branch information
Tksn07 authored Dec 30, 2023
1 parent bb4e0b1 commit fb34081
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/components/AccentPhrase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ const isEditableMora = (vowel: string, moraIndex: number) => {
if (props.selectedDetail == "accent") {
// クリック時の動作はそのアクセント句の読み変更。
// よって、いずれかのモーラがhoverされているならそのアクセント句を強調表示する。
return hoveredMoraIndex.value !== undefined;
return hoveredMoraIndex.value != undefined;
}
if (props.selectedDetail == "pitch") {
// クリック時の動作は無声化/有声化の切り替え。
Expand Down
8 changes: 4 additions & 4 deletions src/components/AudioInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ const handleParameterChange = (
parameter: Parameter,
inputValue: string | number | null
) => {
if (inputValue === null) throw new Error("inputValue is null");
if (inputValue == null) throw new Error("inputValue is null");
const value = adjustSliderValue(
parameter.label + "入力",
inputValue.toString(),
Expand Down Expand Up @@ -760,7 +760,7 @@ const setPresetByScroll = (event: WheelEvent) => {
event.preventDefault();
const presetNumber = selectablePresetList.value.length;
if (presetNumber === 0 || presetNumber === undefined) return;
if (presetNumber === 0 || presetNumber == undefined) return;
const nowIndex = selectablePresetList.value.findIndex(
(value) => value.key == presetSelectModel.value.key
Expand All @@ -770,7 +770,7 @@ const setPresetByScroll = (event: WheelEvent) => {
const newIndex = isUp ? nowIndex + 1 : nowIndex - 1;
if (newIndex < 0 || presetNumber <= newIndex) return;
if (selectablePresetList.value[newIndex] === undefined) return;
if (selectablePresetList.value[newIndex] == undefined) return;
changePreset(selectablePresetList.value[newIndex].key);
};
Expand Down Expand Up @@ -889,7 +889,7 @@ const updatePreset = async (fullApply: boolean) => {
const key = presetList.value.find(
(preset) => preset.label === presetName.value
)?.key;
if (key === undefined) return;
if (key == undefined) return;
const title = presetName.value;
const newPreset = createPresetData(title);
Expand Down
4 changes: 2 additions & 2 deletions src/components/CharacterOrderDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ watch(
// FIXME: 不明なキャラを無視しているので、不明キャラの順番が保存時にリセットされてしまう
characterOrder.value = store.state.userCharacterOrder
.map((speakerUuid) => characterInfosMap.value[speakerUuid])
.filter((info) => info !== undefined) as CharacterInfo[];
.filter((info) => info != undefined) as CharacterInfo[];
// 含まれていないキャラクターを足す
const notIncludesCharacterInfos = props.characterInfos.filter(
Expand Down Expand Up @@ -237,7 +237,7 @@ const togglePlayOrStop = (
index: number
) => {
if (
playing.value === undefined ||
playing.value == undefined ||
speakerUuid !== playing.value.speakerUuid ||
styleInfo.styleId !== playing.value.styleId ||
index !== playing.value.index
Expand Down
4 changes: 2 additions & 2 deletions src/components/CharacterPortrait.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const characterInfo = computed(() => {
const styleId = audioItem?.voice.styleId;
if (
engineId === undefined ||
styleId === undefined ||
engineId == undefined ||
styleId == undefined ||
!store.state.engineIds.some((id) => id === engineId)
)
return undefined;
Expand Down
3 changes: 1 addition & 2 deletions src/components/DefaultStyleListDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ import { useStore } from "@/store";
import { DEFAULT_STYLE_NAME } from "@/store/utility";
import { CharacterInfo, SpeakerId, StyleInfo } from "@/type/preload";
import DefaultStyleSelectDialog from "@/components/DefaultStyleSelectDialog.vue";
const props =
defineProps<{
modelValue: boolean;
Expand Down Expand Up @@ -164,7 +163,7 @@ watch([() => props.modelValue], async ([newValue]) => {
if (newValue) {
speakerWithMultipleStyles.value = store.state.userCharacterOrder
.map((speakerUuid) => characterInfosMap.value[speakerUuid])
.filter((characterInfo) => characterInfo !== undefined)
.filter((characterInfo) => characterInfo != undefined)
.filter(
(characterInfo) => characterInfo.metas.styles.length > 1
) as CharacterInfo[];
Expand Down
2 changes: 1 addition & 1 deletion src/components/DefaultStyleSelectDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const selectStyleIndex = (styleIndex: number) => {
// 音声を再生する。同じ話者/styleIndexだったら停止する。
const selectedStyleInfo = props.characterInfo.metas.styles[styleIndex];
if (
playing.value !== undefined &&
playing.value != undefined &&
playing.value.styleId === selectedStyleInfo.styleId
) {
stop();
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export async function generateAndConnectAndSaveAudioWithDialog({
dispatch
);

if (result === undefined || result.result === "CANCELED") return;
if (result == undefined || result.result === "CANCELED") return;

if (result.result === "SUCCESS") {
if (disableNotifyOnGenerate) return;
Expand Down
2 changes: 1 addition & 1 deletion src/components/EngineManageDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ const engineManageDialogOpenedComputed = computed({
set: (val) => emit("update:modelValue", val),
});
const uiLockedState = ref<null | "addingEngine" | "deletingEngine">(null); // ダイアログ内でstore.getters.UI_LOCKEDは常にtrueなので独自に管理
const uiLocked = computed(() => uiLockedState.value !== null);
const uiLocked = computed(() => uiLockedState.value != null);
const isAddingEngine = ref(false);
const engineLoaderType = ref<EngineLoaderType>("vvpp");
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileNamePatternDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const errorMessage = computed(() => {
}
const result: string[] = [];
if (invalidChar.value !== undefined) {
if (invalidChar.value != undefined) {
result.push(`使用できない文字が含まれています:「${invalidChar.value}」`);
}
if (previewFileName.value.includes("$")) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderBarCustomDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ watch(
if (oldData.length < newData.length) {
selectedButton.value = newData[newData.length - 1];
} else if (
selectedButton.value !== undefined &&
selectedButton.value != undefined &&
oldData.includes(selectedButton.value) &&
!newData.includes(selectedButton.value)
) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/HotkeySettingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ const resetHotkey = async (action: string) => {
.getDefaultHotkeySettings()
.then((defaultSettings: HotkeySetting[]) => {
const setting = defaultSettings.find((value) => value.action == action);
if (setting === undefined) {
if (setting == undefined) {
return;
}
// デフォルトが未設定でない場合は、衝突チェックを行う
Expand All @@ -370,7 +370,7 @@ const resetHotkey = async (action: string) => {
(item) =>
item.combination == setting.combination && item.action != action
);
if (duplicated !== undefined) {
if (duplicated != undefined) {
openHotkeyDialog(action);
lastRecord.value = duplicated.combination;
return;
Expand Down
3 changes: 1 addition & 2 deletions src/components/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ const engineIds = computed(() => store.state.engineIds);
const engineInfos = computed(() => store.state.engineInfos);
const engineManifests = computed(() => store.state.engineManifests);
const enableMultiEngine = computed(() => store.state.enableMultiEngine);
const titleText = computed(
() =>
(isEdited.value ? "*" : "") +
(projectName.value !== undefined ? projectName.value + " - " : "") +
(projectName.value != undefined ? projectName.value + " - " : "") +
"VOICEVOX" +
(currentVersion.value ? " - Ver. " + currentVersion.value : "") +
(isMultiEngineOffMode.value ? " - マルチエンジンオフ" : "") +
Expand Down

0 comments on commit fb34081

Please sign in to comment.