diff options
author | André Oliveira <37463445+SpecialAro@users.noreply.github.com> | 2023-09-04 00:02:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-04 00:02:22 +0100 |
commit | 970738c953865b7346f5f85c576be2af2cdd7f2c (patch) | |
tree | 9a05d25a6d0128b8197f0f38a2a013d1d842cebc /src/stores | |
parent | Upgrade npm modules (#1343) (diff) | |
download | ferdium-app-970738c953865b7346f5f85c576be2af2cdd7f2c.tar.gz ferdium-app-970738c953865b7346f5f85c576be2af2cdd7f2c.tar.zst ferdium-app-970738c953865b7346f5f85c576be2af2cdd7f2c.zip |
feat: add deeplink to service (#1344)
add deeplink to service
Diffstat (limited to 'src/stores')
-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 | ||