\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Topbar.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!../../node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./Topbar.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./Topbar.vue?vue&type=template&id=39501404\"\nimport script from \"./Topbar.vue?vue&type=script&lang=js\"\nexport * from \"./Topbar.vue?vue&type=script&lang=js\"\nimport style0 from \"./Topbar.vue?vue&type=style&index=0&id=39501404&prod&lang=scss\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export default {\r\n data() {\r\n return {\r\n // refresh variables\r\n refreshing: false,\r\n registration: null,\r\n updateExists: false,\r\n };\r\n },\r\n created() {\r\n // Listen for our custom event from the SW registration\r\n document.addEventListener('swUpdated', this.updateAvailable, { once: true });\r\n\r\n // Prevent multiple refreshes\r\n navigator.serviceWorker.addEventListener('controllerchange', () => {\r\n if (this.refreshing) return;\r\n this.refreshing = true;\r\n // Here the actual reload of the page occurs\r\n window.location.reload();\r\n });\r\n },\r\n\r\n methods: {\r\n // Store the SW registration so we can send it a message\r\n // We use `updateExists` to control whatever alert, toast, dialog, etc we want to use\r\n // To alert the user there is an update they need to refresh for\r\n updateAvailable(event) {\r\n this.registration = event.detail;\r\n this.updateExists = true;\r\n },\r\n\r\n // Called when the user accepts the update\r\n refreshApp() {\r\n this.updateExists = false;\r\n // Make sure we only send a 'skip waiting' message if the SW is waiting\r\n if (!this.registration || !this.registration.waiting) return;\r\n // send message to SW to skip the waiting and activate the new SW\r\n this.registration.waiting.postMessage({ type: 'SKIP_WAITING' });\r\n },\r\n },\r\n};\r\n","\r\n