From 9f517350995f14c755f015d85e7d12fa1729cd8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 10 Nov 2024 00:07:41 +0100 Subject: [PATCH] pl-fe: migrate drafts to mutative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/src/actions/draft-statuses.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/pl-fe/src/actions/draft-statuses.ts b/packages/pl-fe/src/actions/draft-statuses.ts index 1947bbb1f..953419f30 100644 --- a/packages/pl-fe/src/actions/draft-statuses.ts +++ b/packages/pl-fe/src/actions/draft-statuses.ts @@ -24,10 +24,12 @@ const fetchDraftStatuses = () => const accountUrl = getAccount(state, state.me as string)!.url; return KVStore.getItem>(`drafts:${accountUrl}`).then((statuses) => { - dispatch({ - type: DRAFT_STATUSES_FETCH_SUCCESS, - statuses, - }); + if (statuses) { + dispatch({ + type: DRAFT_STATUSES_FETCH_SUCCESS, + statuses, + }); + } }).catch(() => {}); };