Add setting to manually clear the tile and geocode caches
This commit is contained in:
parent
410a410d35
commit
50321d2bdc
@ -20,16 +20,29 @@ function logout() {
|
|||||||
|
|
||||||
function resyncAndRestart() {
|
function resyncAndRestart() {
|
||||||
app.toast.show({
|
app.toast.show({
|
||||||
text: "Syncing settings and restarting...",
|
text: "Syncing settings and restarting...",
|
||||||
position: "bottom",
|
position: "bottom",
|
||||||
destroyOnClose: true,
|
destroyOnClose: true,
|
||||||
closeTimeout: 1000 * 10
|
closeTimeout: 1000 * 10
|
||||||
});
|
});
|
||||||
syncNow(function () {
|
syncNow(function () {
|
||||||
restartApplication();
|
restartApplication();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearCaches() {
|
||||||
|
app.toast.show({
|
||||||
|
text: "Clearing caches. You may need to restart the app to see a difference.",
|
||||||
|
position: "bottom",
|
||||||
|
destroyOnClose: true,
|
||||||
|
closeTimeout: 1000 * 10
|
||||||
|
});
|
||||||
|
setStorage("geocode_cache", "{}");
|
||||||
|
if ('caches' in window) {
|
||||||
|
clearAllCaches();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$('.item-content[data-setting=darktheme] .toggle input').on("change", function () {
|
$('.item-content[data-setting=darktheme] .toggle input').on("change", function () {
|
||||||
var checked = $(this).prop('checked');
|
var checked = $(this).prop('checked');
|
||||||
setStorage("darktheme", checked);
|
setStorage("darktheme", checked);
|
||||||
|
@ -113,7 +113,6 @@ var cachedurls = [
|
|||||||
'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff',
|
'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff',
|
||||||
'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff2'
|
'node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff2'
|
||||||
];
|
];
|
||||||
|
|
||||||
for (i in SETTINGS.maptileurls) {
|
for (i in SETTINGS.maptileurls) {
|
||||||
cachedurls.push(SETTINGS.maptileurls[i].json);
|
cachedurls.push(SETTINGS.maptileurls[i].json);
|
||||||
}
|
}
|
||||||
@ -157,4 +156,12 @@ function fillCache(cachename) {
|
|||||||
}, 1000 * 30);
|
}, 1000 * 30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function clearAllCaches() {
|
||||||
|
const keys = await caches.keys();
|
||||||
|
|
||||||
|
for (const key of keys) {
|
||||||
|
caches.delete(key);
|
||||||
|
}
|
||||||
}
|
}
|
@ -388,6 +388,13 @@ var routes = [
|
|||||||
text: "",
|
text: "",
|
||||||
onclick: "openBrowser('https://netsyms.com/legal?pk_campaign=PackageHelperApp')",
|
onclick: "openBrowser('https://netsyms.com/legal?pk_campaign=PackageHelperApp')",
|
||||||
link: true
|
link: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
setting: "clearcache",
|
||||||
|
title: "Clear Cache",
|
||||||
|
text: "Delete saved maps and other temporary data",
|
||||||
|
link: true,
|
||||||
|
onclick: "clearCaches()"
|
||||||
});
|
});
|
||||||
resolve({
|
resolve({
|
||||||
templateUrl: './pages/settings.html'
|
templateUrl: './pages/settings.html'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user