Commit 8a33d1c5 authored by Paul Kaplan's avatar Paul Kaplan

Re-export missing base comment actions to simplify

parent d02ddef8
...@@ -6,6 +6,8 @@ const log = require('../lib/log'); ...@@ -6,6 +6,8 @@ const log = require('../lib/log');
const COMMENT_LIMIT = 20; const COMMENT_LIMIT = 20;
const { const {
addNewComment,
resetComments,
Status, Status,
setFetchStatus, setFetchStatus,
setCommentDeleted, setCommentDeleted,
...@@ -169,5 +171,10 @@ module.exports = { ...@@ -169,5 +171,10 @@ module.exports = {
getReplies, getReplies,
deleteComment, deleteComment,
reportComment, reportComment,
restoreComment restoreComment,
// Re-export these specific action creators directly so the implementer
// does not need to go to two places for comment actions
addNewComment,
resetComments
}; };
...@@ -5,7 +5,7 @@ const Page = require('../../components/page/www/page.jsx'); ...@@ -5,7 +5,7 @@ const Page = require('../../components/page/www/page.jsx');
const render = require('../../lib/render.jsx'); const render = require('../../lib/render.jsx');
const previewActions = require('../../redux/preview.js'); const previewActions = require('../../redux/preview.js');
const commentsActions = require('../../redux/comments.js'); const commentActions = require('../../redux/comments.js');
const isSupportedBrowser = require('../../lib/supported-browser').default; const isSupportedBrowser = require('../../lib/supported-browser').default;
const UnsupportedBrowser = require('./unsupported-browser.jsx'); const UnsupportedBrowser = require('./unsupported-browser.jsx');
...@@ -17,7 +17,7 @@ if (isSupportedBrowser()) { ...@@ -17,7 +17,7 @@ if (isSupportedBrowser()) {
document.getElementById('app'), document.getElementById('app'),
{ {
preview: previewActions.previewReducer, preview: previewActions.previewReducer,
comments: commentsActions.commentsReducer, comments: commentActions.commentsReducer,
...ProjectView.guiReducers ...ProjectView.guiReducers
}, },
{ {
......
...@@ -29,7 +29,6 @@ const Meta = require('./meta.jsx'); ...@@ -29,7 +29,6 @@ const Meta = require('./meta.jsx');
const sessionActions = require('../../redux/session.js'); const sessionActions = require('../../redux/session.js');
const navigationActions = require('../../redux/navigation.js'); const navigationActions = require('../../redux/navigation.js');
const previewActions = require('../../redux/preview.js'); const previewActions = require('../../redux/preview.js');
const commentsActions = require('../../redux/comments.js');
const projectCommentActions = require('../../redux/project-comment-actions.js'); const projectCommentActions = require('../../redux/project-comment-actions.js');
const frameless = require('../../lib/frameless'); const frameless = require('../../lib/frameless');
...@@ -1036,7 +1035,7 @@ const mapStateToProps = state => { ...@@ -1036,7 +1035,7 @@ const mapStateToProps = state => {
const mapDispatchToProps = dispatch => ({ const mapDispatchToProps = dispatch => ({
handleAddComment: (comment, topLevelCommentId) => { handleAddComment: (comment, topLevelCommentId) => {
dispatch(commentsActions.addNewComment(comment, topLevelCommentId)); dispatch(projectCommentActions.addNewComment(comment, topLevelCommentId));
}, },
handleDeleteComment: (projectId, commentId, topLevelCommentId, token) => { handleDeleteComment: (projectId, commentId, topLevelCommentId, token) => {
dispatch(projectCommentActions.deleteComment(projectId, commentId, topLevelCommentId, token)); dispatch(projectCommentActions.deleteComment(projectId, commentId, topLevelCommentId, token));
...@@ -1063,7 +1062,7 @@ const mapDispatchToProps = dispatch => ({ ...@@ -1063,7 +1062,7 @@ const mapDispatchToProps = dispatch => ({
dispatch(navigationActions.toggleLoginOpen()); dispatch(navigationActions.toggleLoginOpen());
}, },
handleSeeAllComments: (id, ownerUsername, isAdmin, token) => { handleSeeAllComments: (id, ownerUsername, isAdmin, token) => {
dispatch(commentsActions.resetComments()); dispatch(projectCommentActions.resetComments());
dispatch(projectCommentActions.getTopLevelComments(id, 0, ownerUsername, isAdmin, token)); dispatch(projectCommentActions.getTopLevelComments(id, 0, ownerUsername, isAdmin, token));
}, },
handleUpdateProjectThumbnail: (id, blob) => { handleUpdateProjectThumbnail: (id, blob) => {
...@@ -1138,7 +1137,7 @@ const mapDispatchToProps = dispatch => ({ ...@@ -1138,7 +1137,7 @@ const mapDispatchToProps = dispatch => ({
}, },
remixProject: () => { remixProject: () => {
dispatch(GUI.remixProject()); dispatch(GUI.remixProject());
dispatch(commentsActions.resetComments()); dispatch(projectCommentActions.resetComments());
}, },
setPlayer: player => { setPlayer: player => {
dispatch(GUI.setPlayer(player)); dispatch(GUI.setPlayer(player));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment