Skip to content

Commit

Permalink
レビュー内容の修正
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkfx committed Dec 11, 2024
1 parent bca347e commit 5c54153
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
16 changes: 7 additions & 9 deletions src/components/Dialog/DictionaryEditWordDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ const stop = () => {
// メニュー系
const yomiInput = ref<QInput>();
const surfaceRef = ref(surface);
const yomiRef = ref(yomi);
const wordPriorityLabels = {
0: "最低",
3: "",
Expand Down Expand Up @@ -280,11 +278,11 @@ const setSurface = (text: string) => {
// surfaceを全角化する
// 入力は半角でも問題ないが、登録時に全角に変換され、isWordChangedの判断がおかしくなることがあるので、
// 入力後に自動で変換するようにする
surfaceRef.value = convertHankakuToZenkaku(text);
surface.value = convertHankakuToZenkaku(text);
};
const saveWord = async () => {
if (!accentPhrase) throw new Error(`accentPhrase === undefined`);
if (!accentPhrase.value) throw new Error(`accentPhrase === undefined`);
const accent = computeRegisteredAccent();
if (selectedId.value) {
try {
Expand Down Expand Up @@ -324,7 +322,6 @@ const saveWord = async () => {
toInitialState();
};
// TODO: リセットする際にsurfaceが読み込めないため、修正する
const resetWord = async (id: string) => {
const result = await store.actions.SHOW_WARNING_DIALOG({
title: "単語の変更をリセットしますか?",
Expand All @@ -345,14 +342,15 @@ const accentPhraseTable = ref<HTMLElement>();
const changeAccent = async (_: number, accent: number) => {
const { engineId, styleId } = voiceComputed.value;
if (accentPhrase.value) {
accentPhrase.value.accent = accent;
accentPhrase.value = (
await createUILockAction(
store.actions.FETCH_MORA_DATA({
accentPhrases: [accentPhrase.value],
engineId: engineId,
styleId: styleId,
engineId,
styleId,
}),
)
)[0];
Expand All @@ -369,15 +367,15 @@ const {
startContextMenuOperation: startSurfaceContextMenuOperation,
clearInputSelection: clearSurfaceInputSelection,
endContextMenuOperation: endSurfaceContextMenuOperation,
} = useRightClickContextMenu(surfaceContextMenu, surfaceInput, surfaceRef);
} = useRightClickContextMenu(surfaceContextMenu, surfaceInput, surface);
const {
contextMenuHeader: yomiContextMenuHeader,
contextMenudata: yomiContextMenudata,
startContextMenuOperation: startYomiContextMenuOperation,
clearInputSelection: clearYomiInputSelection,
endContextMenuOperation: endYomiContextMenuOperation,
} = useRightClickContextMenu(yomiContextMenu, yomiInput, yomiRef);
} = useRightClickContextMenu(yomiContextMenu, yomiInput, yomi);
</script>

<style lang="scss" scoped>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Dialog/DictionaryManageDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@

<script lang="ts">
import { Ref, ComputedRef } from "vue";
// eslint-disable-next-line import/order
import { EngineId, SpeakerId, StyleId } from "@/type/preload";
export interface DictionaryManageDialogContext {
wordEditing: Ref<boolean>;
Expand Down Expand Up @@ -165,7 +167,6 @@ import {
convertLongVowel,
createKanaRegex,
} from "@/domain/japanese";
import { EngineId, SpeakerId, StyleId } from "@/type/preload";
const defaultDictPriority = 5;
Expand Down

0 comments on commit 5c54153

Please sign in to comment.