Update Function

This commit is contained in:
JonatanRek 2020-09-06 12:39:02 +02:00
parent 7167d86285
commit d34dde916e
5 changed files with 28 additions and 22 deletions

View File

@ -1,4 +1,11 @@
{ {
"_args": [
[
"websocket-driver@0.6.5",
"C:\\Users\\ASUS-ROG-NTB\\Disk Google\\git\\VUE_GabenParadise"
]
],
"_development": true,
"_from": "websocket-driver@0.6.5", "_from": "websocket-driver@0.6.5",
"_id": "websocket-driver@0.6.5", "_id": "websocket-driver@0.6.5",
"_inBundle": false, "_inBundle": false,
@ -21,9 +28,8 @@
"/sockjs-client/faye-websocket" "/sockjs-client/faye-websocket"
], ],
"_resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.6.5.tgz", "_resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.6.5.tgz",
"_shasum": "5cb2556ceb85f4373c6d8238aa691c8454e13a36", "_spec": "0.6.5",
"_spec": "websocket-driver@0.6.5", "_where": "C:\\Users\\ASUS-ROG-NTB\\Disk Google\\git\\VUE_GabenParadise",
"_where": "C:\\Users\\ASUS-ROG-NTB\\Disk Google\\git\\freeGames\\gabenparadise\\node_modules\\sockjs",
"author": { "author": {
"name": "James Coglan", "name": "James Coglan",
"email": "jcoglan@gmail.com", "email": "jcoglan@gmail.com",
@ -32,11 +38,9 @@
"bugs": { "bugs": {
"url": "https://github.com/faye/websocket-driver-node/issues" "url": "https://github.com/faye/websocket-driver-node/issues"
}, },
"bundleDependencies": false,
"dependencies": { "dependencies": {
"websocket-extensions": ">=0.1.1" "websocket-extensions": ">=0.1.1"
}, },
"deprecated": false,
"description": "WebSocket protocol handler with pluggable I/O", "description": "WebSocket protocol handler with pluggable I/O",
"devDependencies": { "devDependencies": {
"jstest": "", "jstest": "",

View File

@ -3,7 +3,9 @@
<div v-if="once"> <div v-if="once">
<div class="alert alert-danger" role="alert"> <div class="alert alert-danger" role="alert">
Update Awailible Update Awailible
<button type="button" class="btn btn-primary" v-on:click="refreshApp">Refresh</button> <button type="button" class="btn btn-primary" v-on:click="refreshApp">
Refresh
</button>
</div> </div>
</div> </div>
</template> </template>

View File

@ -30,7 +30,7 @@ if (process.env.NODE_ENV === "production") {
"For more details, visit https://goo.gl/AFskqB" "For more details, visit https://goo.gl/AFskqB"
); );
Notification.requestPermission(function (status) { Notification.requestPermission(function(status) {
console.log("Status ", status); console.log("Status ", status);
if (status === "granted" && startPermission !== "granted") { if (status === "granted" && startPermission !== "granted") {
window.location.reload(); window.location.reload();
@ -50,8 +50,8 @@ if (process.env.NODE_ENV === "production") {
updated(registration) { updated(registration) {
console.log("New content is available; please refresh."); console.log("New content is available; please refresh.");
document.dispatchEvent( document.dispatchEvent(
new CustomEvent('swUpdated', { detail: registration }) new CustomEvent("swUpdated", { detail: registration })
) );
}, },
offline() { offline() {
console.log( console.log(
@ -76,7 +76,7 @@ function subscribeFirebase($registration) {
"BEbiSQ7ishlWlO7v-_EJW3iFk6WmgdSFrPgfXsjLNflqljBqWEZwv-4iyaTaYYE1VM2y1fX9V50QoZ0c8ft5C0s" "BEbiSQ7ishlWlO7v-_EJW3iFk6WmgdSFrPgfXsjLNflqljBqWEZwv-4iyaTaYYE1VM2y1fX9V50QoZ0c8ft5C0s"
); );
messaging.getToken().then(function (token) { messaging.getToken().then(function(token) {
console.log("Token: ", token); console.log("Token: ", token);
console.log(JSON.stringify({ token: token })); console.log(JSON.stringify({ token: token }));
//FIX: New URL //FIX: New URL
@ -92,10 +92,10 @@ function subscribeFirebase($registration) {
} }
} }
) )
.then(function (response) { .then(function(response) {
console.log(response); console.log(response);
}) })
.catch(function (error) { .catch(function(error) {
console.log(error); console.log(error);
}); });
}); });

View File

@ -2,7 +2,7 @@
// debug: true // debug: true
// }); // });
self.addEventListener("push", function (event) { self.addEventListener("push", function(event) {
if (event.data) { if (event.data) {
var data = event.data.json(); var data = event.data.json();
var notOptions = { var notOptions = {
@ -21,7 +21,7 @@ self.addEventListener("push", function (event) {
} }
}); });
self.addEventListener("notificationclick", function (event) { self.addEventListener("notificationclick", function(event) {
if (event.notification) { if (event.notification) {
if (data.data) { if (data.data) {
var data = JSON.parse(event.notification.data.data); var data = JSON.parse(event.notification.data.data);
@ -35,11 +35,11 @@ self.addEventListener("notificationclick", function (event) {
clients.openWindow("/"); clients.openWindow("/");
}); });
self.addEventListener('message', (event) => { self.addEventListener("message", event => {
if (event.data && event.data.type === 'SKIP_WAITING') { if (event.data && event.data.type === "SKIP_WAITING") {
self.skipWaiting() self.skipWaiting();
} }
}) });
self.__precacheManifest = [].concat(self.__precacheManifest || []); self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); workbox.precaching.precacheAndRoute(self.__precacheManifest, {});