only register service-work for editor (#710)

main
Michael Fix 6 years ago committed by GitHub
parent 69d12afc52
commit 9ddb821fa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,3 +1,3 @@
const withOffline = require('next-offline')
module.exports = withOffline()
module.exports = withOffline({ dontAutoRegisterSw: true })

@ -1,6 +1,7 @@
// Theirs
import React from 'react'
import { withRouter } from 'next/router'
import { register, unregister } from 'next-offline/runtime'
import debounce from 'lodash.debounce'
// Ours
@ -11,6 +12,13 @@ import { updateQueryString } from '../lib/routing'
import { saveSettings, clearSettings, omit } from '../lib/util'
class Index extends React.Component {
componentDidMount() {
register()
}
componentWillUnmount() {
unregister()
}
shouldComponentUpdate = () => false
onEditorUpdate = debounce(

Loading…
Cancel
Save