From ee67249b845bc6aa3816058591b1858a8f760bd7 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sat, 20 Jul 2024 23:37:10 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89?= =?UTF-8?q?=E3=81=AEunixMillisec=E3=82=92UUID4=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/command.ts | 2 +- src/store/project.ts | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/store/command.ts b/src/store/command.ts index 2d8e062f38..9af3013e82 100644 --- a/src/store/command.ts +++ b/src/store/command.ts @@ -136,7 +136,7 @@ export const commandStore = createPartialStore({ LAST_COMMAND_IDS: { getter(state) { const getLastCommandId = (commands: Command[]): CommandId | null => { - if (commands.length > 0) return null; + if (commands.length == 0) return null; else return commands[commands.length - 1].id; }; diff --git a/src/store/project.ts b/src/store/project.ts index 4adf90b4ff..4de85b6be7 100755 --- a/src/store/project.ts +++ b/src/store/project.ts @@ -20,6 +20,7 @@ import { DEFAULT_TPQN, } from "@/sing/domain"; import { EditorType } from "@/type/preload"; +import { IsEqual } from "@/type/utility"; export const projectStoreState: ProjectStoreState = { savedLastCommandIds: { talk: null, song: null }, @@ -373,13 +374,11 @@ export const projectStore = createPartialStore({ IS_EDITED: { getter(state, getters) { - if ( - Object.keys(state.savedLastCommandIds) != - Object.keys(getters.LAST_COMMAND_IDS) - ) - throw new Error( - "Object.keys(state.savedLastCommandIds) != Object.keys(getters.LAST_COMMAND_IDS)", - ); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const _: IsEqual< + typeof state.savedLastCommandIds, + typeof getters.LAST_COMMAND_IDS + > = true; return Object.keys(state.savedLastCommandIds).some((_editor) => { const editor = _editor as EditorType; return (