mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2024-11-24 03:42:16 +00:00
11 lines
220 B
TypeScript
11 lines
220 B
TypeScript
|
import { registerSW } from 'virtual:pwa-register';
|
||
|
|
||
|
const updateSW = registerSW({
|
||
|
onNeedRefresh() {
|
||
|
if (confirm('应用程序已更新,是否刷新?')) {
|
||
|
updateSW();
|
||
|
}
|
||
|
},
|
||
|
onOfflineReady() {},
|
||
|
});
|