Browse Source

Fixes and updates

pull/79/head
Matthew Raymer 1 year ago
parent
commit
e813315dad
  1. 30
      additional-scripts.js
  2. 57
      package-lock.json
  3. 3
      package.json
  4. 2
      src/App.vue
  5. 3
      src/db/tables/settings.ts

30
additional-scripts.js

@ -1,30 +0,0 @@
self.addEventListener("push", function (event) {
let payload;
if (event.data) {
payload = JSON.parse(event.data.text());
}
const title = payload ? payload.title : "Custom Title";
const options = {
body: payload ? payload.body : "Custom body text",
icon: payload ? payload.icon : "icon.png",
badge: payload ? payload.badge : "badge.png",
};
event.waitUntil(self.registration.showNotification(title, options));
});
self.addEventListener('message', function(event) {
const data = event.data;
switch (data.command) {
case 'account':
break;
default:
console.log('Unknown command:', data.command);
}
});

57
package-lock.json

@ -52,6 +52,7 @@
"vue": "^3.3.4", "vue": "^3.3.4",
"vue-axios": "^3.5.2", "vue-axios": "^3.5.2",
"vue-facing-decorator": "^3.0.2", "vue-facing-decorator": "^3.0.2",
"vue-qrcode-reader": "^5.4.1",
"vue-router": "^4.2.4", "vue-router": "^4.2.4",
"web-did-resolver": "^2.0.27" "web-did-resolver": "^2.0.27"
}, },
@ -8676,6 +8677,16 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/dom-webcodecs": {
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/@types/dom-webcodecs/-/dom-webcodecs-0.1.10.tgz",
"integrity": "sha512-qQfLMw4yhtagKQApMQKaf21KZeJu3Psysbm/wLQ3mkpyBWY3x3dHCKFcYs43WEH+s8zgTSF0DvJUPWTtyZP0Dw=="
},
"node_modules/@types/emscripten": {
"version": "1.39.10",
"resolved": "https://registry.npmjs.org/@types/emscripten/-/emscripten-1.39.10.tgz",
"integrity": "sha512-TB/6hBkYQJxsZHSqyeuO1Jt0AB/bW6G7rHt9g7lML7SOF6lbgcHvw/Lr+69iqN0qxgXLhWKScAon73JNnptuDw=="
},
"node_modules/@types/eslint": { "node_modules/@types/eslint": {
"version": "8.44.4", "version": "8.44.4",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.4.tgz", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.4.tgz",
@ -11515,6 +11526,15 @@
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
}, },
"node_modules/barcode-detector": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/barcode-detector/-/barcode-detector-2.1.1.tgz",
"integrity": "sha512-yA6gR5u5j22uw2eHSlFGzhYgnnQqx6hc4amDb/r0bKWl2gcDOqVE6SzUE6O87UzJ3ZhjJjM9uG/L9+D705HsKg==",
"dependencies": {
"@types/dom-webcodecs": "^0.1.9",
"zxing-wasm": "1.0.0-rc.4"
}
},
"node_modules/base-64": { "node_modules/base-64": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz",
@ -24637,6 +24657,11 @@
"resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz",
"integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA=="
}, },
"node_modules/sdp": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/sdp/-/sdp-3.2.0.tgz",
"integrity": "sha512-d7wDPgDV3DDiqulJjKiV2865wKsJ34YI+NDREbm+FySq6WuKOikwyNQcm+doLAZ1O6ltdO0SeKle2xMpN3Brgw=="
},
"node_modules/secp256k1": { "node_modules/secp256k1": {
"version": "4.0.3", "version": "4.0.3",
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz",
@ -27264,6 +27289,18 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/vue-qrcode-reader": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/vue-qrcode-reader/-/vue-qrcode-reader-5.4.1.tgz",
"integrity": "sha512-jwETIaRdumSCnXOpp0BkpZW8sySNFUfIPNOFa8oHAEmoSSdKK/ub5C1+3vMwokjU8iNERR2v/YhfBdcWDe0s5A==",
"dependencies": {
"barcode-detector": "2.1.1",
"webrtc-adapter": "8.2.3"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/vue-router": { "node_modules/vue-router": {
"version": "4.2.5", "version": "4.2.5",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.2.5.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.2.5.tgz",
@ -27839,6 +27876,18 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/webrtc-adapter": {
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/webrtc-adapter/-/webrtc-adapter-8.2.3.tgz",
"integrity": "sha512-gnmRz++suzmvxtp3ehQts6s2JtAGPuDPjA1F3a9ckNpG1kYdYuHWYpazoAnL9FS5/B21tKlhkorbdCXat0+4xQ==",
"dependencies": {
"sdp": "^3.2.0"
},
"engines": {
"node": ">=6.0.0",
"npm": ">=3.10.0"
}
},
"node_modules/websocket-driver": { "node_modules/websocket-driver": {
"version": "0.7.4", "version": "0.7.4",
"resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz",
@ -28644,6 +28693,14 @@
"engines": { "engines": {
"node": ">=14" "node": ">=14"
} }
},
"node_modules/zxing-wasm": {
"version": "1.0.0-rc.4",
"resolved": "https://registry.npmjs.org/zxing-wasm/-/zxing-wasm-1.0.0-rc.4.tgz",
"integrity": "sha512-SvVErHUZhzFqpqA2vpwmXeAPa6sgGdUCOkMCd5cMch6L1urZbZCZR8jb2+NI9bCfJRNkQi2ZjME9/NaiUFiSGg==",
"dependencies": {
"@types/emscripten": "^1.39.9"
}
} }
} }
} }

3
package.json

@ -1,6 +1,6 @@
{ {
"name": "kickstart-for-time-pwa", "name": "kickstart-for-time-pwa",
"version": "0.1.0", "version": "0.1.2",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
@ -52,6 +52,7 @@
"vue": "^3.3.4", "vue": "^3.3.4",
"vue-axios": "^3.5.2", "vue-axios": "^3.5.2",
"vue-facing-decorator": "^3.0.2", "vue-facing-decorator": "^3.0.2",
"vue-qrcode-reader": "^5.4.1",
"vue-router": "^4.2.4", "vue-router": "^4.2.4",
"web-did-resolver": "^2.0.27" "web-did-resolver": "^2.0.27"
}, },

2
src/App.vue

@ -278,7 +278,6 @@ export default class App extends Vue {
}); });
} }
private askPermission(): Promise<NotificationPermission> { private askPermission(): Promise<NotificationPermission> {
// Check if Notifications are supported // Check if Notifications are supported
if (!("Notification" in window)) { if (!("Notification" in window)) {
@ -312,7 +311,6 @@ export default class App extends Vue {
}); });
} }
async turnOnNotifications() { async turnOnNotifications() {
return this.askPermission() return this.askPermission()
.then((permission) => { .then((permission) => {

3
src/db/tables/settings.ts

@ -19,9 +19,10 @@ export type Settings = {
lastName?: string; // User's last name lastName?: string; // User's last name
lastViewedClaimId?: string; // Last viewed claim ID lastViewedClaimId?: string; // Last viewed claim ID
lastNotifiedClaimId?: string; // Last notified claim ID lastNotifiedClaimId?: string; // Last notified claim ID
isRegistered?: boolean;
// Array of named search boxes defined by bounding boxes // Array of named search boxes defined by bounding boxes
searchBoxes?: Array<{ searchBoxes?: Array<{
name: string; name: string;
bbox: BoundingBox; bbox: BoundingBox;

Loading…
Cancel
Save