バグ修正

This commit is contained in:
mesi 2024-01-29 06:56:07 +00:00
parent 986b17a3ae
commit ef656ae91e
1 changed files with 9 additions and 0 deletions

View File

@ -688,6 +688,15 @@ function saveDraft() {
function deleteDraft() {
const draftData = JSON.parse(miLocalStorage.getItem('drafts') ?? '{}');
if (postChannel.value) {
// draftKey.valuechannel:${postChannel.value.id}partialDraftKey
// 稿稿稿
const partialDraftKey = draftKey.value.replace(`channel:${postChannel.value.id}`, '');
if (draftData[partialDraftKey]) {
delete draftData[partialDraftKey];
}
}
delete draftData[draftKey.value];
miLocalStorage.setItem('drafts', JSON.stringify(draftData));