mirror of
https://github.com/vector-im/element-web.git
synced 2025-12-16 14:51:56 +01: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 = {
|
module.exports = {
|
||||||
textForEvent: function(ev) {
|
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);
|
if (handler) return handler(ev);
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user