mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
fixed cancel dialog
This commit is contained in:
parent
1a00b98ba3
commit
56fd8ec4cd
3 changed files with 10 additions and 3 deletions
|
@ -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 mapStateToProps> & typeof mapDispatchToProps & { };
|
||||
|
||||
export class CancelDialog extends React.Component<Props, void> {
|
||||
class CancelDialogUnconnected extends React.Component<Props, void> {
|
||||
cancel = () => {
|
||||
this.props.editorStopEditing();
|
||||
};
|
||||
|
@ -46,3 +47,5 @@ export class CancelDialog extends React.Component<Props, void> {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const CancelDialog = connect(mapStateToProps, mapDispatchToProps)(CancelDialogUnconnected)
|
|
@ -56,7 +56,6 @@ const hideLoader = () => {
|
|||
|
||||
function* stopEditingSaga() {
|
||||
const { changed, mode }: ReturnType<typeof selectEditor> = yield select(selectEditor);
|
||||
const { address_origin }: ReturnType<typeof selectMap> = 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() {
|
||||
|
|
|
@ -293,3 +293,7 @@
|
|||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.leaflet-pane {
|
||||
user-select: none;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue