Improve domain splitting for "Hosted by" header

This commit is contained in:
Mira Nord
2025-03-16 19:16:06 +01:00
parent 3fe1016715
commit 22ad0e9289
+2 -2
View File
@@ -137,9 +137,9 @@ export class ClientViewModel extends ViewModel {
const preferredWebInstance = this._client.getPreferredWebInstance(this._link);
if (this._webPlatform && preferredWebInstance) {
let label = preferredWebInstance;
const subDomainIdx = preferredWebInstance.lastIndexOf(".", preferredWebInstance.lastIndexOf("."));
const subDomainIdx = preferredWebInstance.lastIndexOf(".", preferredWebInstance.lastIndexOf(".") - 1);
if (subDomainIdx !== -1) {
label = preferredWebInstance.slice(preferredWebInstance.length - subDomainIdx + 1);
label = preferredWebInstance.slice(subDomainIdx + 1);
}
return `Hosted by ${label}`;
}