From eb4156fc8994c839d0987489f5e1d828758392b7 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Tue, 5 Oct 2021 15:39:33 +0200 Subject: [PATCH] Fixed WebPush Notification error subscription --- package.json | 1 - src/components/CSignIn/CSignIn.ts | 9 +--- src/root/home/home.ts | 43 +--------------- src/root/home/home.vue | 72 -------------------------- src/root/maps/maps.scss | 0 src/root/maps/maps.ts.off | 73 ++++++++++++++++++++++++++ src/root/maps/maps.vue.off | 85 +++++++++++++++++++++++++++++++ src/webpack-require.d.ts | 3 -- yarn.lock | 5 -- 9 files changed, 161 insertions(+), 130 deletions(-) create mode 100755 src/root/maps/maps.scss create mode 100755 src/root/maps/maps.ts.off create mode 100755 src/root/maps/maps.vue.off delete mode 100644 src/webpack-require.d.ts diff --git a/package.json b/package.json index d11aa1a4..175612a4 100755 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "dependencies": { "@quasar/extras": "^1.11.0", "@quasar/quasar-ui-qcalendar": "^4.0.0-beta.6", - "@vue-leaflet/vue-leaflet": "^0.6.1", "@vue/compat": "^3.2.12", "@vue/compiler-sfc": "^3.2.12", "@vue/eslint-config-standard": "^6.1.0", diff --git a/src/components/CSignIn/CSignIn.ts b/src/components/CSignIn/CSignIn.ts index 08a710ef..ed980306 100755 --- a/src/components/CSignIn/CSignIn.ts +++ b/src/components/CSignIn/CSignIn.ts @@ -116,13 +116,8 @@ export default defineComponent({ emit('loginOk') - // GlobalStore.actions.createPushSubscription() - // .then((rissub) => { - // // ... - // }) - // .catch((e) => { - // console.log('ERROR Subscription = ' + e) - // }) + globalStore.createPushSubscription() + } else { emit('checkErrors', riscode) } diff --git a/src/root/home/home.ts b/src/root/home/home.ts index 644fa187..faa82d13 100755 --- a/src/root/home/home.ts +++ b/src/root/home/home.ts @@ -1,58 +1,17 @@ -import { LMap, LIcon, LTileLayer, LMarker, LControlLayers, LTooltip, LPopup, LPolyline, LPolygon, LRectangle, } from '@vue-leaflet/vue-leaflet' - -import 'leaflet/dist/leaflet.css' - import { defineComponent, ref, computed, } from 'vue' + import { tools } from '@src/store/Modules/tools' export default defineComponent({ name: 'Home', - components: { - LMap, - LIcon, - LTileLayer, - LMarker, - LControlLayers, - LTooltip, - LPopup, - LPolyline, - LPolygon, - LRectangle, - }, - setup() { - const zoom = ref(2) - const iconWidth = ref(25) - const iconHeight = ref(40) - - const iconUrl = computed(() => `https://placekitten.com/${iconWidth.value}/${iconHeight.value}`) - const iconSize = computed(() => [iconWidth.value, iconHeight.value]) - - function log(a: any) { - console.log(a) - } - - function changeIcon() { - iconWidth.value += 2 - if (iconWidth.value > iconHeight.value) { - iconWidth.value = Math.floor(iconHeight.value / 2) - } - } - return { tools, - zoom, - iconWidth, - iconHeight, - iconUrl, - iconSize, - changeIcon, - log, } }, }) diff --git a/src/root/home/home.vue b/src/root/home/home.vue index 62302738..9d458050 100755 --- a/src/root/home/home.vue +++ b/src/root/home/home.vue @@ -2,79 +2,7 @@

Inizio:

-
diff --git a/src/root/maps/maps.scss b/src/root/maps/maps.scss new file mode 100755 index 00000000..e69de29b diff --git a/src/root/maps/maps.ts.off b/src/root/maps/maps.ts.off new file mode 100755 index 00000000..4f9a0799 --- /dev/null +++ b/src/root/maps/maps.ts.off @@ -0,0 +1,73 @@ + +// @ts-ignore +import { LMap, LIcon, LTileLayer, LMarker, LControlLayers, LTooltip, LPopup, LPolyline, LPolygon, LRectangle, } from '@vue-leaflet/vue-leaflet' + +import 'leaflet/dist/leaflet.css' + +import { + defineComponent, ref, computed, +} from 'vue' +import { tools } from '@src/store/Modules/tools' + + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const leaflet = require('leaflet'); + +delete leaflet.Icon.Default.prototype._getIconUrl; + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const iconRetinaUrl = require('leaflet/dist/images/marker-icon-2x.png'); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const iconUrl = require('leaflet/dist/images/marker-icon.png'); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const shadowUrl = require('leaflet/dist/images/marker-shadow.png'); + +leaflet.Icon.Default.mergeOptions({ iconRetinaUrl, iconUrl, shadowUrl }) + +export default defineComponent({ + name: 'Home', + components: { + LMap, + LIcon, + LTileLayer, + LMarker, + LControlLayers, + LTooltip, + LPopup, + LPolyline, + LPolygon, + LRectangle, + }, + + setup() { + + const zoom = ref(2) + const iconWidth = ref(25) + const iconHeight = ref(40) + + const iconUrl = computed(() => `https://placekitten.com/${iconWidth.value}/${iconHeight.value}`) + const iconSize = computed(() => [iconWidth.value, iconHeight.value]) + + function log(a: any) { + console.log(a) + } + + function changeIcon() { + iconWidth.value += 2 + if (iconWidth.value > iconHeight.value) { + iconWidth.value = Math.floor(iconHeight.value / 2) + } + } + + return { + tools, + zoom, + iconWidth, + iconHeight, + iconUrl, + iconSize, + changeIcon, + log, + } + }, +}) diff --git a/src/root/maps/maps.vue.off b/src/root/maps/maps.vue.off new file mode 100755 index 00000000..3738b010 --- /dev/null +++ b/src/root/maps/maps.vue.off @@ -0,0 +1,85 @@ + + + diff --git a/src/webpack-require.d.ts b/src/webpack-require.d.ts deleted file mode 100644 index 67f808d1..00000000 --- a/src/webpack-require.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This is required to use Webpack loaders, cf https://stackoverflow.com/a/36151803/257169 - -declare function require(string): any; diff --git a/yarn.lock b/yarn.lock index d8d3286f..42e07cd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2240,11 +2240,6 @@ "@typescript-eslint/types" "4.31.1" eslint-visitor-keys "^2.0.0" -"@vue-leaflet/vue-leaflet@^0.6.1": - version "0.6.1" - resolved "https://registry.yarnpkg.com/@vue-leaflet/vue-leaflet/-/vue-leaflet-0.6.1.tgz#d731a5d2256d049e345f58330616180191d88b12" - integrity sha512-/sm0bdrdftXh5nSGEPsoKrJI1D/GtKiEsBo9X/TA2yu4lYTDcaem6U4t1Ea5CoLleiZRCNUrZr9PG/xHdUPXYA== - "@vue/compat@^3.2.12": version "3.2.12" resolved "https://registry.yarnpkg.com/@vue/compat/-/compat-3.2.12.tgz#e07b78e6a3ad589567dd199e402b6e4acfda433a"