mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
make features available in Client and Session
This commit is contained in:
parent
f65b43f612
commit
d5929d9ebe
@ -55,7 +55,7 @@ export class LoginViewModel extends ViewModel<SegmentType, Options> {
|
||||
const {ready, defaultHomeserver, loginToken} = options;
|
||||
this._ready = ready;
|
||||
this._loginToken = loginToken;
|
||||
this._client = new Client(this.platform);
|
||||
this._client = new Client(this.platform, this.features);
|
||||
this._homeserver = defaultHomeserver;
|
||||
this._initViewModels();
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ import {TokenLoginMethod} from "./login/TokenLoginMethod";
|
||||
import {SSOLoginHelper} from "./login/SSOLoginHelper";
|
||||
import {getDehydratedDevice} from "./e2ee/Dehydration.js";
|
||||
import {Registration} from "./registration/Registration";
|
||||
import {FeatureSet} from "../features";
|
||||
|
||||
export const LoadStatus = createEnum(
|
||||
"NotLoading",
|
||||
@ -53,7 +54,7 @@ export const LoginFailure = createEnum(
|
||||
);
|
||||
|
||||
export class Client {
|
||||
constructor(platform) {
|
||||
constructor(platform, features = new FeatureSet(0)) {
|
||||
this._platform = platform;
|
||||
this._sessionStartedByReconnector = false;
|
||||
this._status = new ObservableValue(LoadStatus.NotLoading);
|
||||
@ -68,6 +69,7 @@ export class Client {
|
||||
this._olmPromise = platform.loadOlm();
|
||||
this._workerPromise = platform.loadOlmWorker();
|
||||
this._accountSetup = undefined;
|
||||
this._features = features;
|
||||
}
|
||||
|
||||
createNewSessionId() {
|
||||
@ -278,6 +280,7 @@ export class Client {
|
||||
olmWorker,
|
||||
mediaRepository,
|
||||
platform: this._platform,
|
||||
features: this._features
|
||||
});
|
||||
await this._session.load(log);
|
||||
if (dehydratedDevice) {
|
||||
|
@ -54,7 +54,7 @@ const PUSHER_KEY = "pusher";
|
||||
|
||||
export class Session {
|
||||
// sessionInfo contains deviceId, userId and homeserver
|
||||
constructor({storage, hsApi, sessionInfo, olm, olmWorker, platform, mediaRepository}) {
|
||||
constructor({storage, hsApi, sessionInfo, olm, olmWorker, platform, mediaRepository, features}) {
|
||||
this._platform = platform;
|
||||
this._storage = storage;
|
||||
this._hsApi = hsApi;
|
||||
|
Loading…
Reference in New Issue
Block a user