mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 13:14:58 +08:00
DRY map lookup
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
91ba939e23
commit
152499a17d
@ -310,7 +310,7 @@ const stateHandlers = {
|
||||
|
||||
module.exports = {
|
||||
textForEvent: function(ev) {
|
||||
const handler = ev.isState() ? stateHandlers[ev.getType()] : handlers[ev.getType()];
|
||||
const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()];
|
||||
if (handler) return handler(ev);
|
||||
return '';
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user