From 4ea1a173a87cc2ae0ee17c0fe03701846e226a3c Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 6 Dec 2022 12:06:17 +0900 Subject: [PATCH] refactor: use ?? --- packages/client/src/components/MkPostForm.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index 4b7730d5d..308dd63dd 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -556,7 +556,7 @@ function saveDraft() { } function deleteDraft() { - const draftData = JSON.parse(localStorage.getItem('drafts') || '{}'); + const draftData = JSON.parse(localStorage.getItem('drafts') ?? '{}'); delete draftData[draftKey]; @@ -571,7 +571,7 @@ async function post() { renoteId: props.renote ? props.renote.id : quoteId ? quoteId : undefined, channelId: props.channel ? props.channel.id : undefined, poll: poll, - cw: useCw ? cw || '' : undefined, + cw: useCw ? cw ?? '' : undefined, localOnly: localOnly, visibility: visibility, visibleUserIds: visibility === 'specified' ? visibleUsers.map(u => u.id) : undefined,