Skip to content

Commit 9b28b69

Browse files
committed
Use the correct back link
1 parent c20acd1 commit 9b28b69

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Frontend/src/components/messages2/FlowDiagram.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ControlButton, Controls } from "@vue-flow/controls";
99
import { useMessageStore } from "@/stores/MessageStore";
1010
import LoadingSpinner from "@/components/LoadingSpinner.vue";
1111
import { storeToRefs } from "pinia";
12-
import { useRoute } from "vue-router";
12+
import { useRouter } from "vue-router";
1313
import EndpointDetails from "@/resources/EndpointDetails.ts";
1414
import { hexToCSSFilter } from "hex-to-css-filter";
1515
import TextEllipses from "@/components/TextEllipses.vue";
@@ -46,7 +46,6 @@ const nodeSpacingY = 200;
4646
4747
const store = useMessageStore();
4848
const { state } = storeToRefs(store);
49-
const route = useRoute();
5049
5150
async function getConversation(conversationId: string) {
5251
await store.loadConversation(conversationId);
@@ -162,8 +161,14 @@ function constructEdges(mappedMessages: MappedMessage[]): DefaultEdge[] {
162161
}
163162
164163
const elements = ref<(Node | DefaultEdge)[]>([]);
164+
const backLink = ref<string>(routeLinks.failedMessage.failedMessages.link);
165165
166166
onMounted(async () => {
167+
const back = useRouter().currentRoute.value.query.back as string;
168+
if (back) {
169+
backLink.value = back;
170+
}
171+
167172
if (!state.value.data.conversation_id) return;
168173
169174
const messages = await getConversation(state.value.data.conversation_id);
@@ -229,8 +234,8 @@ const greenColor = hexToCSSFilter("#00c468").filter;
229234
<i class="fa" :class="typeIcon(data.type)" v-tippy="data.type" />
230235
<div class="lead">
231236
<strong>
232-
<RouterLink v-if="data.isError" :to="{ path: routeLinks.messages.failedMessage.link(data.id), query: { back: route.path } }"><TextEllipses style="width: 204px" :text="data.nodeName" ellipses-style="LeftSide" /></RouterLink>
233-
<RouterLink v-else :to="{ path: routeLinks.messages.successMessage.link(data.messageId, data.id), query: { back: route.path } }"><TextEllipses style="width: 204px" :text="data.nodeName" ellipses-style="LeftSide" /></RouterLink>
237+
<RouterLink v-if="data.isError" :to="{ path: routeLinks.messages.failedMessage.link(data.id), query: { back: backLink } }"><TextEllipses style="width: 204px" :text="data.nodeName" ellipses-style="LeftSide" /></RouterLink>
238+
<RouterLink v-else :to="{ path: routeLinks.messages.successMessage.link(data.messageId, data.id), query: { back: backLink } }"><TextEllipses style="width: 204px" :text="data.nodeName" ellipses-style="LeftSide" /></RouterLink>
234239
</strong>
235240
</div>
236241
<div class="time-sent">

0 commit comments

Comments
 (0)