dialogs: load only 20 routes at start

This commit is contained in:
muerwre 2018-12-07 10:51:11 +07:00
parent b108b1abc9
commit 09658b8126
4 changed files with 12 additions and 23 deletions

View file

@ -332,15 +332,13 @@ function setProviderSaga({ provider }) {
}
function* locationChangeSaga({ location }) {
const { address, editing, ready, user: { id, random_url } } = yield select(getState);
const { address, ready, user: { id, random_url } } = yield select(getState);
if (!ready) return;
const { path, mode } = getUrlData(location);
if (address !== path) {
console.log('LOADING NEW DATA');
const map = yield call(loadMapSaga, path);
if (map && map.owner && mode === 'edit' && map.owner.id !== id) {
@ -348,19 +346,16 @@ function* locationChangeSaga({ location }) {
return;
}
} else if (mode === 'edit' && editor.owner.id !== id) {
console.log('NOT AN OWNER!!!', editor.owner.id, id);
pushPath(`/${random_url}/edit`);
return;
}
if (editing !== (mode === 'edit')) {
if (mode === 'edit') {
yield put(setEditing(true));
editor.startEditing();
} else {
yield put(setEditing(false));
editor.stopEditing();
}
if (mode !== 'edit') {
yield put(setEditing(false));
editor.stopEditing();
} else {
yield put(setEditing(true));
editor.startEditing();
}
}