Custom web instances #1

Merged
Domoel merged 5 commits from custom-web-instances into main 2025-03-29 00:19:32 +01:00
2 changed files with 5 additions and 2 deletions
Showing only changes of commit 6dd9a0213c - Show all commits
+1 -1
View File
@@ -144,7 +144,7 @@ export class SetCustomWebInstanceView extends TemplateView {
evt.preventDefault();
const form = evt.target;
const {instanceHostname} = form.elements;
this.value.setCustomWebInstance(instanceHostname.value || undefined);
this.value.setCustomWebInstance(instanceHostname.value);
this.value.closeCustomWebInstanceForm();
}
+4 -1
View File
@@ -262,8 +262,11 @@ export class ClientViewModel extends ViewModel {
}
setCustomWebInstance(hostname) {
if (hostname) {
hostname = hostname.trim().replace(/^https:\/\//, '').replace(/\/.*$/, '');
}
this.preferences.setClient(this._client.id, hostname ? this._webPlatform : (this._nativePlatform || this._webPlatform));
this.preferences.setCustomWebInstance(this._client.id, hostname);
this.preferences.setCustomWebInstance(this._client.id, hostname || undefined);
this._update();
}
}