mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
20 lines
462 B
JavaScript
20 lines
462 B
JavaScript
const R0_5_0 = "r0.5.0";
|
|
|
|
export class ServerFeatures {
|
|
constructor(versionResponse) {
|
|
this._versionResponse = versionResponse;
|
|
}
|
|
|
|
_supportsVersion(version) {
|
|
if (!this._versionResponse) {
|
|
return false;
|
|
}
|
|
const {versions} = this._versionResponse;
|
|
return Array.isArray(versions) && versions.includes(version);
|
|
}
|
|
|
|
get lazyLoadMembers() {
|
|
return this._supportsVersion(R0_5_0);
|
|
}
|
|
}
|