cancel editing loses is_public

This commit is contained in:
muerwre 2019-02-14 10:18:04 +07:00
parent 8391408bb3
commit 679c485b89
4 changed files with 8 additions and 7 deletions

View file

@ -98,7 +98,7 @@ class Component extends React.PureComponent<Props, void> {
className={classnames({ primary: changed, disabled: !changed })}
onClick={this.startSaveMode}
>
<span className="desktop-only">СХОРОНИТЬ</span>
<span className="desktop-only">СОХРАНИТЬ</span>
<Icon icon="icon-check-1" />
</button>
</div>

View file

@ -10,6 +10,9 @@
## FEATURES
todo hide arrows on small zooms
todo hide stickers and route on small zooms (?)
todo selecting logo on crop
todo save spinner

View file

@ -290,6 +290,7 @@ export class Editor {
setInitialData = () => {
const { path } = getUrlData();
const { id } = this.getUser();
const { is_public } = this.getState();
const { route, stickers, provider } = this.dumpData();
this.initialData = {
@ -301,6 +302,7 @@ export class Editor {
route,
stickers,
provider,
is_public,
};
};

View file

@ -400,7 +400,7 @@ function* changeProviderSaga({ provider }: ReturnType<typeof ActionCreators.chan
}
function* locationChangeSaga({ location }: ReturnType<typeof ActionCreators.locationChanged>) {
const { address, ready, user: { id, random_url } } = yield select(getState);
const { address, ready, user: { id, random_url }, is_public } = yield select(getState);
if (!ready) return;
@ -410,11 +410,9 @@ function* locationChangeSaga({ location }: ReturnType<typeof ActionCreators.loca
const map = yield call(loadMapSaga, path);
if (map && map.owner && mode === 'edit' && map.owner.id !== id) {
// pushPath(`/${map.random_url}/edit`);
return yield call(replaceAddressIfItsBusy, map.random_url, map.address);
}
} else if (mode === 'edit' && editor.owner.id !== id) {
// pushPath(`/${random_url}/edit`);
return yield call(replaceAddressIfItsBusy, random_url, address);
} else {
yield put(setAddressOrigin(''));
@ -553,9 +551,7 @@ function* setUserSaga() {
}
function* setTitleSaga({ title }: ReturnType<typeof ActionCreators.setTitle>):SagaIterator {
if (title) {
document.title = `${title} | Редактор маршрутов`;
}
if (title) { document.title = `${title} | Редактор маршрутов`; }
}
export function* userSaga() {