first import attempts

This commit is contained in:
muerwre 2018-08-29 12:05:09 +07:00
parent 8da254ff9b
commit f7e8da1f1f
9 changed files with 57 additions and 6 deletions

View file

@ -6,9 +6,10 @@ import { Fills } from '$components/Fills';
import { DEFAULT_LOGO } from '$constants/logos';
import { UserLocation } from '$components/UserLocation';
import { DEFAULT_USER } from '$constants/auth';
import { getGuestToken, checkUserToken } from '$utils/api';
import { getGuestToken, checkUserToken, getStoredMap } from '$utils/api';
import { storeData, getData } from '$utils/storage';
import { UserPanel } from '$components/panels/UserPanel';
import { getPath } from '$utils/history';
export class App extends React.Component {
state = {
@ -25,8 +26,14 @@ export class App extends React.Component {
componentDidMount() {
this.authInit();
this.mapInit();
}
mapInit = () => {
const path = getPath();
if (path) getStoredMap({ name: path, callback: this.editor.setData });
};
setMode = mode => {
this.setState({ mode });
};