mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
fixed gpx downloading
This commit is contained in:
parent
18cbeed06e
commit
23b8f5dea6
2 changed files with 20 additions and 8 deletions
|
@ -20,11 +20,20 @@ import { DIALOGS, TABS } from '~/constants/dialogs';
|
|||
import { Tooltip } from '~/components/panels/Tooltip';
|
||||
import { TitleDialog } from '~/components/dialogs/TitleDialog';
|
||||
|
||||
const mapStateToProps = ({ user: { user }, editor: { dialog, dialog_active, is_empty } }) => ({
|
||||
const mapStateToProps = ({
|
||||
user: { user },
|
||||
editor: { dialog, dialog_active },
|
||||
map: { route, stickers },
|
||||
}) => ({
|
||||
editor: {
|
||||
dialog,
|
||||
dialog_active,
|
||||
user,
|
||||
is_empty,
|
||||
},
|
||||
user: { user },
|
||||
map: {
|
||||
route,
|
||||
stickers,
|
||||
}
|
||||
});
|
||||
|
||||
const mapDispatchToProps = {
|
||||
|
@ -91,7 +100,7 @@ export class UserPanelUnconnected extends PureComponent<Props, State> {
|
|||
openAppInfoDialog = () => {
|
||||
this.setMenuOpened();
|
||||
this.props.editorSetDialog(DIALOGS.APP_INFO);
|
||||
this.props.editorSetDialogActive(this.props.dialog !== DIALOGS.APP_INFO);
|
||||
this.props.editorSetDialogActive(this.props.editor.dialog !== DIALOGS.APP_INFO);
|
||||
};
|
||||
|
||||
openOauthFrame = () => {
|
||||
|
@ -109,10 +118,12 @@ export class UserPanelUnconnected extends PureComponent<Props, State> {
|
|||
|
||||
render() {
|
||||
const {
|
||||
props: { user, dialog, dialog_active, is_empty },
|
||||
props: { user: { user }, editor: { dialog, dialog_active }, map: { route, stickers } },
|
||||
state: { menuOpened },
|
||||
} = this;
|
||||
|
||||
const is_empty = !route.length && !stickers.length;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<TitleDialog />
|
||||
|
@ -154,6 +165,7 @@ export class UserPanelUnconnected extends PureComponent<Props, State> {
|
|||
<Icon icon="icon-shot-4" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{!is_empty && (
|
||||
<React.Fragment>
|
||||
<div className="control-sep" />
|
||||
|
|
|
@ -214,7 +214,7 @@ function* keyPressedSaga({ key, target }: ReturnType<typeof editorKeyPressed>) {
|
|||
function* getGPXTrackSaga(): SagaIterator {
|
||||
const { route, stickers, title, address }: ReturnType<typeof selectMap> = yield select(selectMap);
|
||||
|
||||
if (!route || route.length <= 0) return;
|
||||
if (!route.length && !stickers.length) return;
|
||||
|
||||
const track = getGPXString({ route, stickers, title: title || address });
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue