@@ -9,7 +9,7 @@ import { ControlButton, Controls } from "@vue-flow/controls";
9
9
import { useMessageStore } from " @/stores/MessageStore" ;
10
10
import LoadingSpinner from " @/components/LoadingSpinner.vue" ;
11
11
import { storeToRefs } from " pinia" ;
12
- import { useRoute } from " vue-router" ;
12
+ import { useRouter } from " vue-router" ;
13
13
import EndpointDetails from " @/resources/EndpointDetails.ts" ;
14
14
import { hexToCSSFilter } from " hex-to-css-filter" ;
15
15
import TextEllipses from " @/components/TextEllipses.vue" ;
@@ -46,7 +46,6 @@ const nodeSpacingY = 200;
46
46
47
47
const store = useMessageStore ();
48
48
const { state } = storeToRefs (store );
49
- const route = useRoute ();
50
49
51
50
async function getConversation(conversationId : string ) {
52
51
await store .loadConversation (conversationId );
@@ -162,8 +161,14 @@ function constructEdges(mappedMessages: MappedMessage[]): DefaultEdge[] {
162
161
}
163
162
164
163
const elements = ref <(Node | DefaultEdge )[]>([]);
164
+ const backLink = ref <string >(routeLinks .failedMessage .failedMessages .link );
165
165
166
166
onMounted (async () => {
167
+ const back = useRouter ().currentRoute .value .query .back as string ;
168
+ if (back ) {
169
+ backLink .value = back ;
170
+ }
171
+
167
172
if (! state .value .data .conversation_id ) return ;
168
173
169
174
const messages = await getConversation (state .value .data .conversation_id );
@@ -229,8 +234,8 @@ const greenColor = hexToCSSFilter("#00c468").filter;
229
234
<i class =" fa" :class =" typeIcon(data.type)" v-tippy =" data.type" />
230
235
<div class =" lead" >
231
236
<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 >
234
239
</strong >
235
240
</div >
236
241
<div class =" time-sent" >
0 commit comments