diff --git a/package.json b/package.json index 2beb8c7..807d7e8 100644 --- a/package.json +++ b/package.json @@ -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.9", + "version": "1.0.10", "license": "GNU GPL v3", "homepage": "https://wavelovers.ru/", "author": { diff --git a/src/router/assets/queryRoutes.ts b/src/router/assets/queries.ts similarity index 57% rename from src/router/assets/queryRoutes.ts rename to src/router/assets/queries.ts index 219c5e9..0b721e0 100644 --- a/src/router/assets/queryRoutes.ts +++ b/src/router/assets/queries.ts @@ -1,30 +1,30 @@ import IQueryRoute from '@/router/models/IQueryRoute'; -const queryRoutes: Array = [ +const queries: Array = [ { query: '/?custom', - to: '/custom', + path: '/custom', }, { query: '/?manual', - to: '/manual', + path: '/manual', }, { query: '/?diagnostic', - to: '/diagnostic', + path: '/diagnostic', }, { query: '/?faq', - to: '/faq', + path: '/faq', }, { query: '/?about', - to: '/about', + path: '/about', }, { query: '/?donate', - to: '/donate', + path: '/donate', } ]; -export default queryRoutes; +export default queries; diff --git a/src/router/index.ts b/src/router/index.ts index cfc3b0c..d00b104 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -5,7 +5,7 @@ import { import PatternsView from '@/views/PatternsView.vue'; import QueryRouter from '@/router/modules/QueryRouter'; import MetaTagUpdater from '@/router/modules/MetaTagUpdater'; -import queryRoutes from '@/router/assets/queryRoutes'; +import queries from '@/router/assets/queries'; const routes: Array = [ { @@ -356,7 +356,7 @@ router.beforeEach(( from: RouteLocationNormalized, next: NavigationGuardNext ) => { - QueryRouter.update(to, from, next, queryRoutes); + QueryRouter.update(to, from, next, router, queries); MetaTagUpdater.update(to, from, next) }); diff --git a/src/router/models/IQueryRoute.ts b/src/router/models/IQueryRoute.ts index 52d40af..6fce5f6 100644 --- a/src/router/models/IQueryRoute.ts +++ b/src/router/models/IQueryRoute.ts @@ -1,6 +1,6 @@ interface IQueryRoute { query: string; - to: string; + path: string; } export default IQueryRoute; diff --git a/src/router/modules/QueryRouter.ts b/src/router/modules/QueryRouter.ts index 70d3372..0100ff2 100644 --- a/src/router/modules/QueryRouter.ts +++ b/src/router/modules/QueryRouter.ts @@ -1,16 +1,18 @@ -import router from '@/router'; -import { NavigationGuardNext, RouteLocationNormalized } from "vue-router"; +import { + Router, NavigationGuardNext, RouteLocationNormalized +} from "vue-router"; import IQueryRoute from '@/router/models/IQueryRoute'; function updateRoute( to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext, + router: Router, queryRoutes: Array -) { +): void { queryRoutes.forEach((route) => { if (route.query === to.fullPath) { - router.push(route.to); + router.push(route.path); } }); return next();