- 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",
"version": "1.0.1",
"version": "1.0.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "wavelovers",
"version": "1.0.1",
"version": "1.0.2",
"license": "GNU GPL v3",
"dependencies": {
"core-js": "^3.8.3",

View File

@ -2,7 +2,7 @@
"name": "wavelovers",
"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" ],
"version": "1.0.1",
"version": "1.0.2",
"license": "GNU GPL v3",
"homepage": "https://wavelovers.ru/",
"author": {
@ -15,7 +15,7 @@
"url": "https://github.com/eugene-serb/wavelovers/"
},
"bugs": {
"url": "https://github.com/eugene-serb/wavelovers/issues"
"url": "https://github.com/eugene-serb/wavelovers/issues/"
},
"private": true,
"scripts": {

View File

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