From 0178b9812e5444e6a90926957c392a5f617198d1 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 2 Jun 2019 23:39:41 +0200 Subject: [PATCH] Propogate old commands events --- src/commands/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/commands/index.js b/src/commands/index.js index a7ff3c6e2..cb7db818a 100644 --- a/src/commands/index.js +++ b/src/commands/index.js @@ -177,7 +177,15 @@ module.exports = () => { const cmd = require(`./view/${item[1]}`); const cmdName = `core:${item[0]}`; defaultCommands[cmdName] = cmd; - if (oldCmd) defaultCommands[oldCmd] = cmd; + if (oldCmd) { + defaultCommands[oldCmd] = cmd; + // Propogate old commands (can be removed once we stop to call old commands) + ['run', 'stop'].forEach(name => { + em.on(`${name}:${oldCmd}`, (...args) => + em.trigger(`${name}:${cmdName}`, ...args) + ); + }); + } }); if (c.em) c.model = c.em.get('Canvas');