Skip to content

Commit

Permalink
[fix] UI: Error when clicking on 'Apps' in the application configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
stenya committed Jan 31, 2025
1 parent f021ec2 commit d8108bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion desktop/angular/src/app/pages/app-view/app-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="flex justify-between items-center p-4 px-12 text-xxs">
<!-- Breadcrumbs -->
<div class="flex items-center">
<a class="text-secondary hover:text-primary" [routerLink]="['/app/overview']">Apps</a>
<div class="cursor-pointer text-secondary hover:text-primary" [routerLink]="['/app/overview']">Apps</div>
<svg viewBox="0 0 24 24" class="inline-block w-4 h-4 text-secondary">
<g fill="none" class="inner" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.2" d="M10 16l4-4-4-4" />
Expand Down
8 changes: 7 additions & 1 deletion desktop/angular/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ if (typeof (CSS as any)['registerProperty'] === 'function') {
}

function handleExternalResources(e: Event) {
// TODO:
// This code executes "openExternal()" when any "<a />" element in the app is clicked.
// This could potentially be a security issue.
// We should consider restricting this to only external links that belong to a certain domain (e.g., https://safing.io).

// get click target
let target: HTMLElement | null = e.target as HTMLElement;
// traverse until we reach an a tag

// traverse until we reach element "<a />"
while (!!target && target.tagName !== "A") {
target = target.parentElement;
}
Expand Down

0 comments on commit d8108bf

Please sign in to comment.