From 56fd8ec4cd0346faccf704d5f1feb1d6e1b0495e Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Tue, 14 Jan 2020 11:08:26 +0700 Subject: [PATCH] fixed cancel dialog --- src/components/dialogs/CancelDialog.tsx | 5 ++++- src/redux/editor/sagas.ts | 4 ++-- src/styles/map.less | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/dialogs/CancelDialog.tsx b/src/components/dialogs/CancelDialog.tsx index 0684caf..463f551 100644 --- a/src/components/dialogs/CancelDialog.tsx +++ b/src/components/dialogs/CancelDialog.tsx @@ -3,6 +3,7 @@ import React from 'react'; import { MODES } from '~/constants/modes'; import { Icon } from '~/components/panels/Icon'; import { editorSetMode, editorStopEditing } from '~/redux/editor/actions'; +import { connect } from 'react-redux'; const mapStateToProps = () => ({}); const mapDispatchToProps = { @@ -12,7 +13,7 @@ const mapDispatchToProps = { type Props = ReturnType & typeof mapDispatchToProps & { }; -export class CancelDialog extends React.Component { +class CancelDialogUnconnected extends React.Component { cancel = () => { this.props.editorStopEditing(); }; @@ -46,3 +47,5 @@ export class CancelDialog extends React.Component { ); } } + +export const CancelDialog = connect(mapStateToProps, mapDispatchToProps)(CancelDialogUnconnected) \ No newline at end of file diff --git a/src/redux/editor/sagas.ts b/src/redux/editor/sagas.ts index 7023438..ca4919b 100644 --- a/src/redux/editor/sagas.ts +++ b/src/redux/editor/sagas.ts @@ -56,7 +56,6 @@ const hideLoader = () => { function* stopEditingSaga() { const { changed, mode }: ReturnType = yield select(selectEditor); - const { address_origin }: ReturnType = yield select(selectMap); const { path } = getUrlData(); if (changed && mode !== MODES.CONFIRM_CANCEL) { @@ -66,8 +65,9 @@ function* stopEditingSaga() { yield put(editorSetMode(MODES.NONE)); yield put(editorSetChanged(false)); + yield put(editorSetReady(true)); - yield pushPath(`/${address_origin || path}/`); + yield pushPath(`/${path}/`); } function* checkOSRMServiceSaga() { diff --git a/src/styles/map.less b/src/styles/map.less index 17fffb2..8ee85fc 100644 --- a/src/styles/map.less +++ b/src/styles/map.less @@ -292,4 +292,8 @@ width: 100%; height: 100%; } +} + +.leaflet-pane { + user-select: none; } \ No newline at end of file