Skip to content

Commit

Permalink
fix(download): fix editable trackname
Browse files Browse the repository at this point in the history
  • Loading branch information
devshred committed Apr 27, 2024
1 parent d983551 commit 51148e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/merge/DownloadLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const DownloadLink: React.FC<DownloadLinkProps> = ({
'?mode=dl&type=' +
type +
(optimizeWaypoints ? '&mode=opt' : '') +
(trackname.length > 0 ? `&name=${trackname}` : '') +
(trackname.length > 0 ? `&name=${encodeToBase64(trackname)}` : '') +
(geoJson != null
? `&wp=${encodeToBase64(JSON.stringify(geoJson))}`
: '')
Expand Down
4 changes: 2 additions & 2 deletions src/components/merge/TrackHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DownloadLink from './DownloadLink.tsx'
import { FaCircleInfo, FaPenToSquare } from 'react-icons/fa6'
import ContentEditable, { ContentEditableEvent } from 'react-contenteditable'
import React, { useEffect, useMemo, useRef, useState } from 'react'
import React, { useMemo, useRef, useState } from 'react'
import { WayPoint } from '../../@types/gps.ts'
import { generateGeoJson, sanitizeFilename } from '../common/tools.ts'
import ResetButton from './ResetButton.tsx'
Expand All @@ -27,7 +27,7 @@ const TrackHeader: React.FC<TrackHeaderProps> = ({
[markerPositions]
)

useEffect(() => {
useMemo(() => {
tracknameRef.current = trackname
}, [])

Expand Down

0 comments on commit 51148e0

Please sign in to comment.