优化前端,优化前端指令,优化自定义控制
This commit is contained in:
@@ -4,12 +4,8 @@
|
||||
}
|
||||
|
||||
function showUpdate(registration) {
|
||||
const badge = document.querySelector("#pwaBadge");
|
||||
if (!badge) return;
|
||||
badge.hidden = false;
|
||||
badge.innerHTML = '<i data-lucide="refresh-cw"></i><span>发现更新</span>';
|
||||
badge.onclick = () => registration.waiting?.postMessage({ type: "SKIP_WAITING" });
|
||||
window.lucide?.createIcons?.({ attrs: { "aria-hidden": "true" }, nodes: [badge] });
|
||||
notify("检测到前端更新,正在刷新页面");
|
||||
registration.waiting?.postMessage({ type: "SKIP_WAITING" });
|
||||
}
|
||||
|
||||
async function register() {
|
||||
|
||||
Reference in New Issue
Block a user