use correct title for track

This commit is contained in:
Sebastian Hugentobler 2021-06-16 13:27:51 +02:00
parent 85de91c668
commit 6419d5defd
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0
2 changed files with 5 additions and 5 deletions

View File

@ -76,7 +76,7 @@ function trackTitle(geoJson) {
const route = geoJson.segments[0]; const route = geoJson.segments[0];
const book = geoJson.book_route_number ? `${geoJson.book_route_number} - ` : ""; const book = geoJson.book_route_number ? `${geoJson.book_route_number} - ` : "";
return `${book}${route.route_id} ${route.title}`; return `${book}${geoJson.title}`;
} }
/** /**
@ -182,7 +182,7 @@ function handleClick(tab) {
let downloading = browser.downloads.download({ let downloading = browser.downloads.download({
url : objectURL, url : objectURL,
filename : `track-${gpxTrack.title}.gpx`, filename : `${gpxTrack.title}.gpx`,
saveAs: true, saveAs: true,
conflictAction : 'uniquify' conflictAction : 'uniquify'
}); });
@ -222,7 +222,7 @@ function updateIcon(tab) {
tabId: tab.id tabId: tab.id
}); });
browser.browserAction.setTitle({ browser.browserAction.setTitle({
title: hasTrack ? `Download track ${gpxTrack.title}` : 'No track selected', title: hasTrack ? `Download track "${gpxTrack.title}"` : 'No track selected',
tabId: tab.id tabId: tab.id
}); });
} }

View File

@ -2,7 +2,7 @@
"manifest_version": 2, "manifest_version": 2,
"name": "SAC Route Portal GPX Downloader", "name": "SAC Route Portal GPX Downloader",
"version": "0.5", "version": "0.6",
"developer": { "developer": {
"name": "Sebastian Hugentobler", "name": "Sebastian Hugentobler",
"url": "https://code.vanwa.ch/sebastian/sac-route-portal-gpx-fx" "url": "https://code.vanwa.ch/sebastian/sac-route-portal-gpx-fx"