Map: update force refresh function
This commit is contained in:
parent
a579c5448b
commit
5c27cfcad8
|
|
@ -2510,11 +2510,31 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function forceRefresh() {
|
async function forceRefresh() {
|
||||||
|
const cssFiles = [
|
||||||
|
'assets/css/mapMAPCSS.css',
|
||||||
|
'assets/css/main.css',
|
||||||
|
'assets/css/leftside-modal.css'
|
||||||
|
];
|
||||||
|
|
||||||
|
// CSS 강제 새로고침
|
||||||
|
cssFiles.forEach(file => {
|
||||||
|
const link = document.querySelector(`link[href^="${file}"]`);
|
||||||
|
if (link) {
|
||||||
|
const href = link.href.split('?')[0];
|
||||||
|
link.href = href + '?view=map&_=' + new Date().getTime();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 브라우저 캐시 삭제
|
||||||
if ('caches' in window) {
|
if ('caches' in window) {
|
||||||
const keys = await caches.keys();
|
const keys = await caches.keys();
|
||||||
await Promise.all(keys.map(key => caches.delete(key)));
|
await Promise.all(keys.map(key => caches.delete(key)));
|
||||||
}
|
}
|
||||||
window.location.reload();
|
|
||||||
|
// 페이지 새로고침
|
||||||
|
const url = new URL(window.location.href);
|
||||||
|
url.searchParams.set('view', 'map'); // view=map 유지
|
||||||
|
window.location.href = url.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.point-overlay').on(
|
$('.point-overlay').on(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue