You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
Switch to using stable values for Threads (#2228)
This commit is contained in:
@@ -70,6 +70,22 @@ export class NamespacedValue<S extends string, U extends string> {
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerControlledNamespacedValue<S extends string, U extends string>
|
||||
extends NamespacedValue<S, U> {
|
||||
private preferUnstable = false;
|
||||
|
||||
public setPreferUnstable(preferUnstable: boolean): void {
|
||||
this.preferUnstable = preferUnstable;
|
||||
}
|
||||
|
||||
public get name(): U | S {
|
||||
if (this.stable && !this.preferUnstable) {
|
||||
return this.stable;
|
||||
}
|
||||
return this.unstable;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a namespaced value which prioritizes the unstable value over the stable
|
||||
* value.
|
||||
|
||||
Reference in New Issue
Block a user