pref: do not auto save when the setting modal is open (#4567)

#### What type of PR is this?

/kind improvement
/area console

#### What this PR does / why we need it:

当设置模态框打开时,禁用自动保存功能。

#### How to test it?

1. 新建一篇文章,随意输入内容。
2. 打开保存或发布表单,填写文章标题等内容
3. 切换至其他 tab 页
4. 再切换回来,查看文章标题是否没有被覆盖。

#### Which issue(s) this PR fixes:

Fixes #4566 

#### Does this PR introduce a user-facing change?
```release-note
当文章或页面设置窗口打开时,禁用自动保存功能。
```
pull/4551/head
Takagi 2023-09-07 15:20:10 +08:00 committed by GitHub
parent 87ca74cb64
commit f3cf3ca283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -353,6 +353,10 @@ const {
);
useAutoSaveContent(currentCache, toRef(formState.value.content, "raw"), () => {
// Do not save when the setting modal is open
if (settingModal.value) {
return;
}
handleSave({ mute: true });
});

View File

@ -369,6 +369,10 @@ const {
);
useAutoSaveContent(currentCache, toRef(formState.value.content, "raw"), () => {
// Do not save when the setting modal is open
if (settingModal.value) {
return;
}
handleSave({ mute: true });
});