pl-fe: WIP migrate settings store to zustand
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
@ -3,10 +3,10 @@ import { FormattedMessage, defineMessages, useIntl } from 'react-intl';
|
||||
|
||||
import { setComposeToStatus } from 'pl-fe/actions/compose';
|
||||
import { cancelDraftStatus } from 'pl-fe/actions/draft-statuses';
|
||||
import { getSettings } from 'pl-fe/actions/settings';
|
||||
import { Button, HStack } from 'pl-fe/components/ui';
|
||||
import { useAppDispatch } from 'pl-fe/hooks';
|
||||
import { useModalsStore } from 'pl-fe/stores';
|
||||
import { useSettingsStore } from 'pl-fe/stores/settings';
|
||||
|
||||
import type { Status as StatusEntity } from 'pl-fe/normalizers';
|
||||
import type { DraftStatus } from 'pl-fe/reducers/draft-statuses';
|
||||
@ -26,12 +26,13 @@ const DraftStatusActionBar: React.FC<IDraftStatusActionBar> = ({ source, status
|
||||
const intl = useIntl();
|
||||
|
||||
const { openModal } = useModalsStore();
|
||||
const { settings } = useSettingsStore();
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const handleCancelClick = () => {
|
||||
dispatch((_, getState) => {
|
||||
|
||||
const deleteModal = getSettings(getState()).get('deleteModal');
|
||||
const deleteModal = settings.deleteModal;
|
||||
if (!deleteModal) {
|
||||
dispatch(cancelDraftStatus(source.draft_id));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user