Skip to content

Commit

Permalink
SAVE_TEMP_PROJECT_FILE の中で行っていた条件分岐を呼び出し側に移動
Browse files Browse the repository at this point in the history
  • Loading branch information
shm11C3 committed Jan 25, 2024
1 parent f7a111b commit 7b0f0e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/store/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,6 @@ export const projectStore = createPartialStore<ProjectStoreTypes>({
SAVE_TEMP_PROJECT_FILE: {
async action(context) {
try {
const { audioItems, audioKeys } = context.state;

// 初期状態の audioItems の場合
if (audioKeys.length <= 1 && !audioItems[audioKeys[0]].text) {
return;
}
context.dispatch("GENERATE_WORKSPACE", { tempProjectState: "unSaved" });
} catch (err) {
window.electron.logError(err);
Expand Down
7 changes: 6 additions & 1 deletion src/views/EditorHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,12 @@ watch(
// N秒ごとに保存がされていない場合のみ一時ファイルを保存
const saveTempFileIntervalSec = isProduction ? 60 : 1;
const interval = setInterval(async () => {
if (isEdited.value && !uiLocked.value) {
if (
isEdited.value &&
!uiLocked.value &&
audioKeys.value.length > 0 &&
audioItems.value[audioKeys.value[0]].text
) {
await store.dispatch("SAVE_TEMP_PROJECT_FILE");
}
}, saveTempFileIntervalSec * 1000);
Expand Down

0 comments on commit 7b0f0e8

Please sign in to comment.