pl-fe: migrate drafts to mutative

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-11-10 00:07:41 +01:00
parent 5c58196201
commit 9f51735099

View file

@ -24,10 +24,12 @@ const fetchDraftStatuses = () =>
const accountUrl = getAccount(state, state.me as string)!.url;
return KVStore.getItem<Array<APIEntity>>(`drafts:${accountUrl}`).then((statuses) => {
dispatch<DraftStatusesFetchSuccessAction>({
type: DRAFT_STATUSES_FETCH_SUCCESS,
statuses,
});
if (statuses) {
dispatch<DraftStatusesFetchSuccessAction>({
type: DRAFT_STATUSES_FETCH_SUCCESS,
statuses,
});
}
}).catch(() => {});
};