diff options
Diffstat (limited to 'src/stores/AppStore.ts')
-rw-r--r-- | src/stores/AppStore.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts index 1c1336819..df8c17c01 100644 --- a/src/stores/AppStore.ts +++ b/src/stores/AppStore.ts | |||
@@ -263,6 +263,20 @@ export default class AppStore extends TypedStore { | |||
263 | url = url.replace(/\/$/, ''); | 263 | url = url.replace(/\/$/, ''); |
264 | url = url.replace(/\s?--(updated)/, ''); | 264 | url = url.replace(/\s?--(updated)/, ''); |
265 | 265 | ||
266 | if (url.startsWith('service/')) { | ||
267 | const pattern = /service\/([^/]+)/; | ||
268 | // Use the exec method to extract the id from the URL | ||
269 | const match = pattern.exec(url); | ||
270 | |||
271 | if (match) { | ||
272 | const id = match[1]; // The id is captured in the first capture group | ||
273 | this.actions.service.setActive({ | ||
274 | serviceId: id, | ||
275 | }); | ||
276 | } | ||
277 | return; | ||
278 | } | ||
279 | |||
266 | this.stores.router.push(url); | 280 | this.stores.router.push(url); |
267 | }); | 281 | }); |
268 | 282 | ||