Skip to content

Commit 85e6fee

Browse files
committed
fix(lib): links to other applications
* If no brand domain is the same as current domain, return the default brand.
1 parent 48404ea commit 85e6fee

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

libs/perun/services/src/lib/other-applications.service.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ export class OtherApplicationsService {
2626
return brand;
2727
}
2828
}
29-
return brands[0];
29+
// return the default brand if NO brand domain is the same as the current domain
30+
const defaultBrand = brands.filter((brand) => brand.name === 'default')[0];
31+
if (defaultBrand) {
32+
return defaultBrand;
33+
} else {
34+
// if the default brand doesn't exist, return the first brand in the list
35+
return brands[0];
36+
}
3037
}
3138

3239
/**

0 commit comments

Comments
 (0)