Interface: RegisterSwEvents

Properties

offlineReady

offlineReady: string

First install. The app is ready to work offline


registered

registered: string

SW has been registered


registerError

registerError: string

Something went wrong during SW registration


waitingRefresh

waitingRefresh: string

A new SW has been detected but the old one is still active. You may ask the user to reload the page

window.addEventListener("rsbuild-plugin-pwa:waiting-refresh", function () {
  if (
    window.confirm("A new version of the app is available. Reload the page?")
  ) {
    window.location.reload();
  }
});