- fixed adding and removing event listeners.

- updated version.
- updated packages.
- rebuild.
This commit is contained in:
Eugene Serb 2022-08-27 18:53:51 +03:00
parent b31e987c72
commit a66df1331a
3 changed files with 16 additions and 10 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "wavelovers", "name": "wavelovers",
"version": "1.0.1", "version": "1.0.2",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "wavelovers", "name": "wavelovers",
"version": "1.0.1", "version": "1.0.2",
"license": "GNU GPL v3", "license": "GNU GPL v3",
"dependencies": { "dependencies": {
"core-js": "^3.8.3", "core-js": "^3.8.3",

View File

@ -2,7 +2,7 @@
"name": "wavelovers", "name": "wavelovers",
"description": "Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.", "description": "Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad.",
"keywords": [ "wavelovers", "gamepad-vibrator", "gamepad-test-tool", "gamepad-vibration-test-tool" ], "keywords": [ "wavelovers", "gamepad-vibrator", "gamepad-test-tool", "gamepad-vibration-test-tool" ],
"version": "1.0.1", "version": "1.0.2",
"license": "GNU GPL v3", "license": "GNU GPL v3",
"homepage": "https://wavelovers.ru/", "homepage": "https://wavelovers.ru/",
"author": { "author": {
@ -15,7 +15,7 @@
"url": "https://github.com/eugene-serb/wavelovers/" "url": "https://github.com/eugene-serb/wavelovers/"
}, },
"bugs": { "bugs": {
"url": "https://github.com/eugene-serb/wavelovers/issues" "url": "https://github.com/eugene-serb/wavelovers/issues/"
}, },
"private": true, "private": true,
"scripts": { "scripts": {

View File

@ -21,13 +21,19 @@
FooterItem: FooterItem, FooterItem: FooterItem,
}, },
methods: { methods: {
addEventListeners(): void { addGamepad: function (event: GamepadEvent): void {
window.addEventListener('gamepadconnected', (event: GamepadEvent) => store.dispatch('addGamepad', event)); store.dispatch('addGamepad', event);
window.addEventListener('gamepaddisconnected', (event: GamepadEvent) => store.dispatch('deleteGamepad', event));
}, },
removeEventListeners(): void { deleteGamepad: function (event: GamepadEvent): void {
window.removeEventListener('gamepadconnected', (event: GamepadEvent) => store.dispatch('addGamepad', event)); store.dispatch('deleteGamepad', event);
window.removeEventListener('gamepaddisconnected', (event: GamepadEvent) => store.dispatch('deleteGamepad', event)); },
addEventListeners: function (): void {
window.addEventListener('gamepadconnected', this.addGamepad);
window.addEventListener('gamepaddisconnected', this.deleteGamepad);
},
removeEventListeners: function (): void {
window.removeEventListener('gamepadconnected', this.addGamepad);
window.removeEventListener('gamepaddisconnected', this.deleteGamepad);
}, },
}, },
mounted() { mounted() {