diff --git a/Models/Constants.ts b/Models/Constants.ts index 6ff090f5b4..3a8a11fe7f 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -1,3 +1,5 @@ +import {Utils} from "../Utils"; + export default class Constants { public static vNumber = "0.20.0"; @@ -70,6 +72,9 @@ export default class Constants { static countryCoderEndpoint: string = "https://raw.githubusercontent.com/pietervdvn/MapComplete-data/main/latlon2country"; private static isRetina(): boolean { + if(Utils.runningFromConsole){ + return false; + } // The cause for this line of code: https://github.com/pietervdvn/MapComplete/issues/115 // See https://stackoverflow.com/questions/19689715/what-is-the-best-way-to-detect-retina-support-on-a-device-using-javascript return ((window.matchMedia && (window.matchMedia('only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx), only screen and (min-resolution: 75.6dpcm)').matches || window.matchMedia('only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min--moz-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2)').matches)) || (window.devicePixelRatio && window.devicePixelRatio >= 2)); diff --git a/service-worker.ts b/service-worker.ts index 879d8b68b4..121ade39b6 100644 --- a/service-worker.ts +++ b/service-worker.ts @@ -28,7 +28,9 @@ async function activate() { title: "Some action" }] })*/ + caches.keys().then(keys => { + // Remove all old caches Promise.all( keys.map(key => key !== version && caches.delete(key)) );