Fix/ts errors in fe (#2218)
Some checks failed
supersonic CentOS CI / build (21) (push) Has been cancelled
supersonic mac CI / build (21) (push) Has been cancelled
supersonic ubuntu CI / build (21) (push) Has been cancelled
supersonic windows CI / build (21) (push) Has been cancelled

This commit is contained in:
poncheen
2025-04-11 20:58:35 +08:00
committed by GitHub
parent 97710a90c4
commit 5585b9e222
18 changed files with 262 additions and 258 deletions

View File

@@ -1,7 +1,7 @@
import { Button, message, notification } from 'antd';
import React from 'react';
import { useIntl } from 'umi';
import { useIntl } from '@umijs/max';
import defaultSettings from '../config/defaultSettings';
const { pwa } = defaultSettings;
@@ -37,7 +37,7 @@ if (pwa) {
worker.postMessage({ type: 'skip-waiting' }, [channel.port2]);
});
// Refresh current page to use the updated HTML and other assets after SW has skiped waiting
window.location.reload(true);
(window.location.reload as (forceReload?: boolean) => void)(true); //兼容老版IE,现在浏览器中此方法均不再接收参数
return true;
};
const key = `open${Date.now()}`;
@@ -75,7 +75,7 @@ if (pwa) {
});
// remove all caches
if (window.caches && window.caches.keys) {
if ('caches' in window) {
caches.keys().then((keys) => {
keys.forEach((key) => {
caches.delete(key);