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

@ -9,7 +9,7 @@ module.exports = async (req, res) => {
path: 'routes',
select: '_id title distance owner updated_at',
options: {
limit: 100,
limit: 20,
sort: { updated_at: -1 },
}
});

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();
}
}

View file

@ -32,7 +32,7 @@
border-radius: @panel_radius;
box-shadow: @dialog_shadow;
&::before {
&::before, &::after {
content: ' ';
height: 40px;
width: 100%;
@ -43,19 +43,13 @@
background: linear-gradient(180deg, rgba(39, 21, 53, 1), rgba(39, 21, 53, 0));
position: absolute;
z-index: 5;
pointer-events: none;
}
&::after {
content: ' ';
height: 40px;
width: 100%;
left: 0;
top: auto;
bottom: 0;
// background: linear-gradient(0deg, rgba(2, 13, 43, 1) 50%, rgba(2,13,43,0));
// background: linear-gradient(0deg, rgba(34, 34, 34, 1) 50%, rgba(34, 34, 34, 0));
background: linear-gradient(0deg, rgba(39, 21, 53, 1), rgba(39, 21, 53, 0));
position: absolute;
z-index: 5;
}
}

View file

@ -91,7 +91,7 @@ body {
&::after {
content: ' ';
width: 7px;
width: 5px;
height: 100%;
display: block;
right: 0;