mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
Label magic number
This commit is contained in:
parent
371916e68a
commit
acba597e8b
@ -16,6 +16,9 @@ limitations under the License.
|
|||||||
|
|
||||||
export const EVENT_TYPE = "m.room.power_levels";
|
export const EVENT_TYPE = "m.room.power_levels";
|
||||||
|
|
||||||
|
// See https://spec.matrix.org/latest/client-server-api/#mroompower_levels
|
||||||
|
const STATE_DEFAULT_POWER_LEVEL = 50;
|
||||||
|
|
||||||
export class PowerLevels {
|
export class PowerLevels {
|
||||||
constructor({powerLevelEvent, createEvent, ownUserId, membership}) {
|
constructor({powerLevelEvent, createEvent, ownUserId, membership}) {
|
||||||
this._plEvent = powerLevelEvent;
|
this._plEvent = powerLevelEvent;
|
||||||
@ -70,8 +73,7 @@ export class PowerLevels {
|
|||||||
if (typeof level === "number") {
|
if (typeof level === "number") {
|
||||||
return level;
|
return level;
|
||||||
} else {
|
} else {
|
||||||
// TODO: Why does this default to 50?
|
return STATE_DEFAULT_POWER_LEVEL;
|
||||||
return 50;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user