From 17bc396b06fea740c11d28177031f500d770570d Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 11 Aug 2017 20:55:23 +0700 Subject: [PATCH 1/3] Fix Ignored User in permalink --- client/coral-embed-stream/style/default.css | 2 +- client/coral-framework/hocs/withMutation.js | 4 ++-- client/coral-framework/hocs/withQuery.js | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/coral-embed-stream/style/default.css b/client/coral-embed-stream/style/default.css index 802cd2e5b..6ba376096 100644 --- a/client/coral-embed-stream/style/default.css +++ b/client/coral-embed-stream/style/default.css @@ -13,7 +13,7 @@ body { width: 100%; font-size: 14px; margin: 0px; - padding: 0px 0px 50px 0px; + padding: 0px 0px 100px 0px; height: auto !important; } diff --git a/client/coral-framework/hocs/withMutation.js b/client/coral-framework/hocs/withMutation.js index c9108c0fe..7e2c3d09d 100644 --- a/client/coral-framework/hocs/withMutation.js +++ b/client/coral-framework/hocs/withMutation.js @@ -92,13 +92,13 @@ export default (document, config = {}) => (WrappedComponent) => { // Do not run updates when we have mutation errors. return prev; } - return map[key](prev, result); + return map[key](prev, result) || prev; }; } else { const existing = res[key]; res[key] = (prev, result) => { const next = existing(prev, result); - return map[key](next, result); + return map[key](next, result) || next; }; } }); diff --git a/client/coral-framework/hocs/withQuery.js b/client/coral-framework/hocs/withQuery.js index adb67b7b3..82c9c29d4 100644 --- a/client/coral-framework/hocs/withQuery.js +++ b/client/coral-framework/hocs/withQuery.js @@ -128,8 +128,10 @@ export default (document, config = {}) => (WrappedComponent) => { const reducer = withSkipOnErrors( reducerCallbacks.reduce( - (a, b) => (prev, ...rest) => - b(a(prev, ...rest), ...rest), + (a, b) => (prev, ...rest) => { + const next = a(prev, ...rest); + return b(next, ...rest) || next; + } )); return { From abda77a7e725fe4fa2a304527d51ec21994a7fb3 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 14 Aug 2017 19:55:04 +0700 Subject: [PATCH 2/3] Fix console error in offtopic --- .../talk-plugin-offtopic/client/components/OffTopicFilter.js | 1 - .../talk-plugin-offtopic/client/containers/OffTopicFilter.js | 4 ---- 2 files changed, 5 deletions(-) diff --git a/plugins/talk-plugin-offtopic/client/components/OffTopicFilter.js b/plugins/talk-plugin-offtopic/client/components/OffTopicFilter.js index 171bafeb2..426dea29a 100644 --- a/plugins/talk-plugin-offtopic/client/components/OffTopicFilter.js +++ b/plugins/talk-plugin-offtopic/client/components/OffTopicFilter.js @@ -16,7 +16,6 @@ export default class OffTopicFilter extends React.Component { this.props.removeCommentClassName(idx); this.props.toggleCheckbox(); } - this.props.closeViewingOptions(); } render() { diff --git a/plugins/talk-plugin-offtopic/client/containers/OffTopicFilter.js b/plugins/talk-plugin-offtopic/client/containers/OffTopicFilter.js index 9548b764e..7eab8c526 100644 --- a/plugins/talk-plugin-offtopic/client/containers/OffTopicFilter.js +++ b/plugins/talk-plugin-offtopic/client/containers/OffTopicFilter.js @@ -3,9 +3,6 @@ import {bindActionCreators} from 'redux'; import {toggleCheckbox} from '../actions'; import {commentClassNamesSelector} from 'plugin-api/alpha/client/selectors'; import OffTopicFilter from '../components/OffTopicFilter'; -import { - closeViewingOptions -} from 'plugins/talk-plugin-viewing-options/client/actions'; import { addCommentClassName, removeCommentClassName @@ -20,7 +17,6 @@ const mapDispatchToProps = (dispatch) => bindActionCreators( { toggleCheckbox, - closeViewingOptions, addCommentClassName, removeCommentClassName }, From db37a0b38ef3226ee34be491eb2622e65b0646b0 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 15 Aug 2017 16:43:44 +0700 Subject: [PATCH 3/3] Check existance of featuredComments in query --- plugins/talk-plugin-featured-comments/client/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/talk-plugin-featured-comments/client/index.js b/plugins/talk-plugin-featured-comments/client/index.js index 82cba8b91..ad10f87ca 100644 --- a/plugins/talk-plugin-featured-comments/client/index.js +++ b/plugins/talk-plugin-featured-comments/client/index.js @@ -26,6 +26,9 @@ export default { IgnoreUser: ({variables}) => ({ updateQueries: { CoralEmbedStream_Embed: (previous) => { + if (!previous.asset.featuredComments) { + return previous; + } const ignoredUserId = variables.id; const newNodes = previous.asset.featuredComments.nodes.filter((n) => n.user.id !== ignoredUserId); const removedCount = previous.asset.featuredComments.nodes.length - newNodes.length;