File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -135,10 +135,8 @@ const noMoreChats = ref(false)
135
135
const loadingSeparator = ref <InstanceType <typeof ChatPreview >[]>([])
136
136
137
137
const chatPagePartnerId = computed (() => {
138
- const partnerId = route .params .partnerId
139
-
140
- // To convert it to string immediately => no need in further type conversion
141
- return Array .isArray (partnerId ) ? partnerId [0 ] : partnerId
138
+ // We assume partnerId to always be a string
139
+ return route .params .partnerId as string
142
140
})
143
141
const isSnackbarShowing = computed (() => store .state .snackbar .show )
144
142
const noActiveNodesDialog = computed (() => store .state .chat .noActiveNodesDialog )
@@ -218,12 +216,13 @@ const checkIsActive = (contactId: string) => {
218
216
const onKeydownHandler = (e : KeyboardEvent ) => {
219
217
if (canPressEscape .value ) {
220
218
if (e .key === ' Escape' ) {
221
- if (! route .query .from ) {
222
- return router .push ({ name: ' Chats' })
219
+ if (route .query .from ?.includes (' chats' )) {
220
+ router .push (route .query .from as string )
221
+ return
223
222
}
224
-
225
- const from = Array . isArray ( route . query . from ) ? route . query . from [ 0 ] : route . query . from
226
- return from ? router . push ( from ) : router . push ({ name: ' Chats ' })
223
+ router . push ({
224
+ name: ' Chats '
225
+ })
227
226
}
228
227
}
229
228
}
You can’t perform that action at this time.
0 commit comments