mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
document title changes on route load
This commit is contained in:
parent
a04b903206
commit
8391408bb3
3 changed files with 14 additions and 6 deletions
|
@ -141,7 +141,7 @@ const run = async () => {
|
||||||
title: '',
|
title: '',
|
||||||
version: 1,
|
version: 1,
|
||||||
distance: calcPolyDistance(route),
|
distance: calcPolyDistance(route),
|
||||||
is_public: true,
|
is_public: false,
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -131,8 +131,6 @@ export class Sticker {
|
||||||
window.removeEventListener('touchend', this.onDragStop);
|
window.removeEventListener('touchend', this.onDragStop);
|
||||||
|
|
||||||
this.lockMapClicks(false);
|
this.lockMapClicks(false);
|
||||||
|
|
||||||
// this.marker.enableEdit();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onDrag = e => {
|
onDrag = e => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { REHYDRATE } from 'redux-persist';
|
import { REHYDRATE } from 'redux-persist';
|
||||||
import { delay } from 'redux-saga';
|
import { delay, SagaIterator } from 'redux-saga';
|
||||||
import { takeLatest, select, call, put, takeEvery, race, take } from 'redux-saga/effects';
|
import { takeLatest, select, call, put, takeEvery, race, take } from 'redux-saga/effects';
|
||||||
import {
|
import {
|
||||||
checkIframeToken,
|
checkIframeToken,
|
||||||
|
@ -517,7 +517,9 @@ function* searchSetTabSaga() {
|
||||||
yield call(searchSetSaga);
|
yield call(searchSetSaga);
|
||||||
}
|
}
|
||||||
|
|
||||||
function* setSaveSuccessSaga({ address, title, is_public }: ReturnType<typeof ActionCreators.setSaveSuccess>) {
|
function* setSaveSuccessSaga({
|
||||||
|
address, title, is_public
|
||||||
|
}: ReturnType<typeof ActionCreators.setSaveSuccess>) {
|
||||||
const { id } = yield select(getUser);
|
const { id } = yield select(getUser);
|
||||||
const { dialog_active } = yield select(getState);
|
const { dialog_active } = yield select(getState);
|
||||||
|
|
||||||
|
@ -537,7 +539,7 @@ function* setSaveSuccessSaga({ address, title, is_public }: ReturnType<typeof Ac
|
||||||
return yield editor.setInitialData();
|
return yield editor.setInitialData();
|
||||||
}
|
}
|
||||||
|
|
||||||
function* userLogoutSaga() {
|
function* userLogoutSaga():SagaIterator {
|
||||||
yield put(setUser(DEFAULT_USER));
|
yield put(setUser(DEFAULT_USER));
|
||||||
yield call(generateGuestSaga);
|
yield call(generateGuestSaga);
|
||||||
}
|
}
|
||||||
|
@ -550,6 +552,12 @@ function* setUserSaga() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function* setTitleSaga({ title }: ReturnType<typeof ActionCreators.setTitle>):SagaIterator {
|
||||||
|
if (title) {
|
||||||
|
document.title = `${title} | Редактор маршрутов`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function* userSaga() {
|
export function* userSaga() {
|
||||||
yield takeLatest(REHYDRATE, authCheckSaga);
|
yield takeLatest(REHYDRATE, authCheckSaga);
|
||||||
yield takeEvery(ACTIONS.SET_MODE, setModeSaga);
|
yield takeEvery(ACTIONS.SET_MODE, setModeSaga);
|
||||||
|
@ -583,6 +591,8 @@ export function* userSaga() {
|
||||||
|
|
||||||
// yield takeLatest(ACTIONS.IFRAME_LOGIN_VK, iframeLoginVkSaga);
|
// yield takeLatest(ACTIONS.IFRAME_LOGIN_VK, iframeLoginVkSaga);
|
||||||
|
|
||||||
|
yield takeLatest(ACTIONS.SET_TITLE, setTitleSaga);
|
||||||
|
|
||||||
yield takeLatest([
|
yield takeLatest([
|
||||||
ACTIONS.SEARCH_SET_TITLE,
|
ACTIONS.SEARCH_SET_TITLE,
|
||||||
ACTIONS.SEARCH_SET_DISTANCE,
|
ACTIONS.SEARCH_SET_DISTANCE,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue