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', path: 'routes',
select: '_id title distance owner updated_at', select: '_id title distance owner updated_at',
options: { options: {
limit: 100, limit: 20,
sort: { updated_at: -1 }, sort: { updated_at: -1 },
} }
}); });

View file

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

View file

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