From 49ca54b3201401d2a69394159125bded323fad15 Mon Sep 17 00:00:00 2001 From: Maximilian Harz Date: Mon, 30 Jun 2025 13:35:41 +0200 Subject: [PATCH] Handle all chat routes in one component --- webapp/nuxt.config.js | 13 ++++++ webapp/pages/{chat/index.vue => chat.vue} | 3 +- webapp/pages/chat/_roomId.vue | 52 ----------------------- 3 files changed, 15 insertions(+), 53 deletions(-) rename webapp/pages/{chat/index.vue => chat.vue} (88%) delete mode 100644 webapp/pages/chat/_roomId.vue diff --git a/webapp/nuxt.config.js b/webapp/nuxt.config.js index 206272642..64f511fd8 100644 --- a/webapp/nuxt.config.js +++ b/webapp/nuxt.config.js @@ -138,6 +138,19 @@ export default { middleware: ['authenticated', 'termsAndConditions'], linkActiveClass: 'router-link-active', linkExactActiveClass: 'router-link-exact-active', + extendRoutes(routes, resolve) { + // Remove the default /chat route + const chatIndex = routes.findIndex((r) => r.name === 'chat') + if (chatIndex !== -1) { + routes.splice(chatIndex, 1) + } + + routes.push({ + name: 'chat', + path: '/chat/:id?', + component: resolve(__dirname, 'pages/chat.vue'), + }) + }, }, /* diff --git a/webapp/pages/chat/index.vue b/webapp/pages/chat.vue similarity index 88% rename from webapp/pages/chat/index.vue rename to webapp/pages/chat.vue index bff4c1172..9f2bfe6f9 100644 --- a/webapp/pages/chat/index.vue +++ b/webapp/pages/chat.vue @@ -7,7 +7,7 @@ /> -
- - -
- - -