diff --git a/client/package-lock.json b/client/package-lock.json index 5205d81a..e4b02b6f 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -4197,9 +4197,9 @@ } }, "date-fns": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.5.0.tgz", - "integrity": "sha512-I6Tkis01//nRcmvMQw/MRE1HAtcuA5Ie6jGPb8bJZJub7494LGOObqkV3ParnsSVviAjk5C8mNKDqYVBzCopWg==" + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.5.1.tgz", + "integrity": "sha512-ZBrQmuaqH9YqIejbgu8f09ki7wdD2JxWsRTZ/+HnnLNmkI56ty0evnWzKY+ihLT0xX5VdUX0vDNZCxJJGKX2+Q==" }, "date-now": { "version": "0.1.4", @@ -11223,9 +11223,9 @@ } }, "redux-orm": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/redux-orm/-/redux-orm-0.14.1.tgz", - "integrity": "sha512-0bh1nFxEmdV1SvYfYRmXx9KKhOURCR+Gl8GSGl+Hc7ePjF3v8mCVDIhQlANgdbs/8fXte7ZpOoVb0Syl+0i8pw==", + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/redux-orm/-/redux-orm-0.15.0.tgz", + "integrity": "sha512-/QPZrCWU712pJzwOvWnwCm+5oCygN8i2T6ZxBiGwDBrm+FSHOMxdmaHA+M1e0iEE+pwiYow6EnqsMNuFwtTpew==", "requires": { "@babel/runtime": "^7.6.0", "immutable-ops": "^0.7.0", diff --git a/client/package.json b/client/package.json index 12af50a9..cf14c105 100755 --- a/client/package.json +++ b/client/package.json @@ -34,7 +34,7 @@ "axios": "^0.19.0", "classnames": "^2.2.6", "connected-react-router": "^6.5.2", - "date-fns": "^2.5.0", + "date-fns": "^2.5.1", "dequal": "^1.0.0", "history": "^4.10.1", "i18next": "^17.2.0", @@ -55,7 +55,7 @@ "react-textarea-autosize": "^7.1.0", "redux": "^4.0.4", "redux-logger": "^3.0.6", - "redux-orm": "^0.14.1", + "redux-orm": "^0.15.0", "redux-saga": "^1.1.1", "reselect": "^4.0.0", "sails.io.js": "^1.2.1", diff --git a/client/src/hooks/use-previous.js b/client/src/hooks/use-previous.js index 191b4d8e..8075356e 100644 --- a/client/src/hooks/use-previous.js +++ b/client/src/hooks/use-previous.js @@ -1,7 +1,7 @@ import { useEffect, useRef } from 'react'; export default (value) => { - const prevValue = useRef(value); + const prevValue = useRef(); useEffect(() => { prevValue.current = value; diff --git a/server/api/controllers/comment-actions/create.js b/server/api/controllers/comment-actions/create.js index 7d9dcc4c..8f9172e1 100755 --- a/server/api/controllers/comment-actions/create.js +++ b/server/api/controllers/comment-actions/create.js @@ -44,7 +44,7 @@ module.exports = { data: _.pick(inputs, ['text']) }; - const action = await sails.helpers.createAction(card, currentUser, values); + const action = await sails.helpers.createAction(card, currentUser, values, this.req); return exits.success({ item: action diff --git a/server/api/helpers/create-action.js b/server/api/helpers/create-action.js index 221cef53..91300726 100644 --- a/server/api/helpers/create-action.js +++ b/server/api/helpers/create-action.js @@ -11,6 +11,9 @@ module.exports = { values: { type: 'json', required: true + }, + request: { + type: 'ref' } }, @@ -21,9 +24,14 @@ module.exports = { userId: inputs.user.id }).fetch(); - sails.sockets.broadcast(`board:${inputs.card.boardId}`, 'actionCreate', { - item: action - }); + sails.sockets.broadcast( + `board:${inputs.card.boardId}`, + 'actionCreate', + { + item: action + }, + inputs.request + ); const userIds = await sails.helpers.getSubscriptionUserIdsForCard( action.cardId,