Merge pull request #883 from vector-im/thirdroom/configurable-device-name

Third Room: Configurable device name
This commit is contained in:
Robert Long 2022-09-28 09:30:44 -07:00 committed by GitHub
commit f72190043d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ export const LoginFailure = createEnum(
);
export class Client {
constructor(platform) {
constructor(platform, options) {
this._platform = platform;
this._sessionStartedByReconnector = false;
this._status = new ObservableValue(LoadStatus.NotLoading);
@ -70,6 +70,7 @@ export class Client {
this._olmPromise = platform.loadOlm();
this._workerPromise = platform.loadOlmWorker();
this._accountSetup = undefined;
this._deviceName = options?.deviceName || "Hydrogen";
}
createNewSessionId() {
@ -181,7 +182,7 @@ export class Client {
try {
const request = this._platform.request;
const hsApi = new HomeServerApi({homeserver: loginMethod.homeserver, request});
const loginData = await loginMethod.login(hsApi, "Hydrogen", log);
const loginData = await loginMethod.login(hsApi, this._deviceName, log);
const sessionId = this.createNewSessionId();
sessionInfo = {
id: sessionId,