mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
31 lines
823 B
TypeScript
31 lines
823 B
TypeScript
import renderApp from './render'
|
|
import { isClashX, setupJsBridge } from '@lib/jsBridge'
|
|
// import * as OfflinePluginRuntime from 'offline-plugin/runtime'
|
|
|
|
/**
|
|
* Global entry
|
|
* Will check if need setup jsbridge
|
|
*/
|
|
if (isClashX()) {
|
|
setupJsBridge(renderApp)
|
|
} else {
|
|
renderApp()
|
|
}
|
|
|
|
// PWA install
|
|
// OfflinePluginRuntime.install({
|
|
// onUpdateReady: () => {
|
|
// console.log('SW Event:', 'onUpdateReady')
|
|
// // Tells to new SW to take control immediately
|
|
// OfflinePluginRuntime.applyUpdate()
|
|
// },
|
|
// onUpdated: () => {
|
|
// console.log('SW Event:', 'onUpdated')
|
|
// // Reload the webpage to load into the new version
|
|
// window.location.reload()
|
|
// },
|
|
// onUpdateFailed: () => {
|
|
// console.error('SW Event:', 'onUpdateFailed')
|
|
// }
|
|
// })
|