Browse Source

rm pwa (#4090)

pull/4095/head
陈帅 7 years ago
committed by GitHub
parent
commit
46d8462caa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/defaultSettings.js
  2. 7
      src/global.js

2
src/defaultSettings.js

@ -10,7 +10,7 @@ module.exports = {
disableLocal: false,
},
title: 'Ant Design Pro',
pwa: true,
pwa: false,
// Your custom iconfont Symbol script Url
// eg://at.alicdn.com/t/font_1039637_btcrd5co4w.js
// 注意:如果需要图标多色,Iconfont 图标项目里要进行批量去色处理

7
src/global.js

@ -3,8 +3,6 @@ import { notification, Button, message } from 'antd';
import { formatMessage } from 'umi-plugin-react/locale';
import defaultSettings from './defaultSettings';
window.React = React;
const { pwa } = defaultSettings;
// if pwa is true
if (pwa) {
@ -58,4 +56,9 @@ if (pwa) {
onClose: async () => {},
});
});
} else if ('serviceWorker' in navigator) {
// eslint-disable-next-line compat/compat
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}

Loading…
Cancel
Save