diff --git a/dist/client/client_api.js b/dist/client/client_api.js index 7dd5d12c8bdf..175603ca9a5a 100644 --- a/dist/client/client_api.js +++ b/dist/client/client_api.js @@ -89,9 +89,12 @@ var ClientApi = function () { // Remove events from the args. Otherwise, it creates a huge JSON string. - if (args[0] && typeof args[0].preventDefault === 'function') { - args[0] = '[SyntheticEvent]'; - } + args = args.map(function (arg) { + if (typeof arg.preventDefault === 'function') { + return '[SyntheticEvent]'; + } + return arg; + }); var id = ++idGenerator; var data = { name: name, args: args }; diff --git a/src/client/client_api.js b/src/client/client_api.js index 6a1bdfa22981..b3911f907e87 100644 --- a/src/client/client_api.js +++ b/src/client/client_api.js @@ -42,16 +42,16 @@ export default class ClientApi { const syncedStore = this._syncedStore; return function (..._args) { - const args = Array.from(_args); + let args = Array.from(_args); let { actions = [] } = syncedStore.getData(); // Remove events from the args. Otherwise, it creates a huge JSON string. - if ( - args[0] && - typeof args[0].preventDefault === 'function' - ) { - args[0] = '[SyntheticEvent]'; - } + args = args.map(arg => { + if (typeof arg.preventDefault === 'function') { + return '[SyntheticEvent]'; + } + return arg; + }); const id = ++idGenerator; const data = { name, args };