import: added hash to url translation for old maps support

editor: fixed setProvider
This commit is contained in:
muerwre 2018-12-10 10:48:08 +07:00
parent 7bf737b62b
commit d95f51bd3b
3 changed files with 28 additions and 10 deletions

View file

@ -102,8 +102,19 @@ function* loadMapSaga(path) {
}
function* mapInitSaga() {
const { hash } = getUrlData();
if (hash && /^#map/.test(hash)) {
const [, newUrl] = hash.match(/^#map[:/?!](.*)$/);
if (newUrl) {
yield pushPath(`/${newUrl}`);
}
}
const { path, mode } = getUrlData();
if (path) {
const map = yield call(loadMapSaga, path);
// const map = yield call(getStoredMap, { name: path });
@ -326,7 +337,9 @@ function* cropAShotSaga(params) {
}
function setProviderSaga({ provider }) {
editor.setProvider(provider);
// editor.setProvider(provider);
editor.provider = provider;
editor.map.setProvider(provider);
return put(setMode(MODES.NONE));
}