From 92acf03ccedaa06924c2313571eea9acd5fd012c Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 15 Nov 2023 21:21:59 -0500 Subject: [PATCH] Fix monkeypatched vue-router event links. App is no longer available here, so we use the event bus. Not ideal, but this keeps the structure the same for now. --- client/src/entry/analysis/modules/Analysis.vue | 9 +++++---- client/src/entry/analysis/router-push.ts | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/entry/analysis/modules/Analysis.vue b/client/src/entry/analysis/modules/Analysis.vue index e067e31ba066..1c646e1b0ce4 100644 --- a/client/src/entry/analysis/modules/Analysis.vue +++ b/client/src/entry/analysis/modules/Analysis.vue @@ -1,6 +1,6 @@ diff --git a/client/src/entry/analysis/router-push.ts b/client/src/entry/analysis/router-push.ts index 495bc4434439..31f85121d43c 100644 --- a/client/src/entry/analysis/router-push.ts +++ b/client/src/entry/analysis/router-push.ts @@ -1,8 +1,10 @@ +import { useEventBus } from "@vueuse/core"; import { type RouteLocationRaw, type Router } from "vue-router"; import { getGalaxyInstance } from "@/app"; import { addSearchParams } from "@/utils/url"; +const { emit } = useEventBus("router-push"); /** * Is called before the regular router.push() and allows us to provide logs, * handle the window manager, avoid duplication warnings, and force a component @@ -36,7 +38,7 @@ export function patchRouterPush(router: Router) { } // Always emit event, even when a duplicate route is pushed - // this.app.emit("router-push"); + emit(); // Avoid console warning when user clicks to revisit the same route return originalPush.call(this, location).catch((err: Error) => {