Skip to content

Commit

Permalink
Fix deep link parsing, once again
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphiiko committed Nov 21, 2024
1 parent d34a638 commit 45666af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Possible crash when encountering time issues on log cleanup
- Deep link parsing being broken, once again

## [1.14.6]

Expand Down
6 changes: 4 additions & 2 deletions src-ui/app/services/deep-link.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ export class DeepLinkService {

private async handleDeepLinkCall(url: URL) {
let pathname = url.pathname;
console.log(url);
// Remove any leading slashes
while (pathname.startsWith('/')) pathname = pathname.substring(1);
const route = [url.hostname, ...pathname.split('/')];
const route = [url.hostname, ...pathname.split('/')].map((p) => p.trim()).filter(Boolean);
switch (route[0]) {
case 'integration':
if (route.length < 2) break;
Expand All @@ -49,6 +48,9 @@ export class DeepLinkService {
break;
default:
await warn(`[DeepLinkService] Couldn't handle deep link type: ${route[0]}`);
await warn(`[DeepLinkService] - href: ${url.href}`);
await warn(`[DeepLinkService] - hostname: ${url.hostname}`);
await warn(`[DeepLinkService] - pathname: ${url.pathname}`);
}
}

Expand Down

0 comments on commit 45666af

Please sign in to comment.