mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 23:53:25 +00:00
disable cookie request
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
import { _ } from 'svelte-i18n';
|
import { _ } from 'svelte-i18n';
|
||||||
import { writable, get } from 'svelte/store';
|
import { writable, get } from 'svelte/store';
|
||||||
import { map, setStravaHeatmapURLs } from '$lib/stores';
|
import { map, setStravaHeatmapURLs } from '$lib/stores';
|
||||||
|
import { browser } from '$app/environment';
|
||||||
|
|
||||||
const { selectedBasemapTree, selectedOverlayTree, stravaHeatmapColor, currentOverlays } =
|
const { selectedBasemapTree, selectedOverlayTree, stravaHeatmapColor, currentOverlays } =
|
||||||
settings;
|
settings;
|
||||||
@@ -65,7 +66,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if ($stravaHeatmapColor) {
|
$: if ($stravaHeatmapColor && browser) {
|
||||||
setStravaHeatmapURLs();
|
setStravaHeatmapURLs();
|
||||||
if ($stravaHeatmapColor !== get(selectedHeatmapColor).value) {
|
if ($stravaHeatmapColor !== get(selectedHeatmapColor).value) {
|
||||||
let toSelect = heatmapColors.find(({ value }) => value === $stravaHeatmapColor);
|
let toSelect = heatmapColors.find(({ value }) => value === $stravaHeatmapColor);
|
||||||
|
@@ -242,6 +242,8 @@ export function exportFile(file: GPXFile) {
|
|||||||
|
|
||||||
let stravaCookies: any = null;
|
let stravaCookies: any = null;
|
||||||
function refreshStravaCookies() {
|
function refreshStravaCookies() {
|
||||||
|
/*
|
||||||
|
TODO
|
||||||
if (stravaCookies === null) {
|
if (stravaCookies === null) {
|
||||||
return fetch('https://s.gpx.studio')
|
return fetch('https://s.gpx.studio')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
@@ -258,6 +260,8 @@ function refreshStravaCookies() {
|
|||||||
} else {
|
} else {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setStravaHeatmapURLs() {
|
export function setStravaHeatmapURLs() {
|
||||||
@@ -274,7 +278,7 @@ export function setStravaHeatmapURLs() {
|
|||||||
for (let activity of Object.keys(overlayTree.overlays.world.strava)) {
|
for (let activity of Object.keys(overlayTree.overlays.world.strava)) {
|
||||||
overlays[activity].tiles = [];
|
overlays[activity].tiles = [];
|
||||||
for (let server of stravaHeatmapServers) {
|
for (let server of stravaHeatmapServers) {
|
||||||
overlays[activity].tiles.push(`${server}/${stravaHeatmapActivityIds[activity]}/${get(settings.stravaHeatmapColor)}/{z}/{x}/{y}@2x.png?Signature=${stravaCookies['CloudFront-Signature']}&Key-Pair-Id=${stravaCookies['CloudFront-Key-Pair-Id']}&Policy=${stravaCookies['CloudFront-Policy']}`);
|
overlays[activity].tiles.push(`${server}/${stravaHeatmapActivityIds[activity]}/${get(settings.stravaHeatmapColor)}/{z}/{x}/{y}@2x.png`); //?Signature=${stravaCookies['CloudFront-Signature']}&Key-Pair-Id=${stravaCookies['CloudFront-Key-Pair-Id']}&Policy=${stravaCookies['CloudFront-Policy']}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user