mirror of
https://github.com/wassname/talk.git
synced 2026-07-18 12:40:13 +08:00
Less deprecation messages
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import * as actions from '../constants/stream';
|
||||
import { buildUrl } from 'coral-framework/utils/url';
|
||||
import queryString from 'query-string';
|
||||
import once from 'lodash/once';
|
||||
|
||||
export const setActiveReplyBox = id => ({
|
||||
type: actions.SET_ACTIVE_REPLY_BOX,
|
||||
@@ -73,31 +72,18 @@ export const setActiveTab = tab => dispatch => {
|
||||
};
|
||||
|
||||
// @Deprecated
|
||||
const showOldTagsWarningOnce = once(() => {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.warn(
|
||||
'`addCommentBoxTag`, `removeCommentBoxTag`, `clearCommentBoxTags` are deprecated. Please switch to `onInputChange`, `input.tags` instead'
|
||||
);
|
||||
}
|
||||
export const addCommentBoxTag = tag => ({
|
||||
type: actions.ADD_COMMENT_BOX_TAG,
|
||||
tag,
|
||||
});
|
||||
|
||||
export const addCommentBoxTag = tag => {
|
||||
showOldTagsWarningOnce();
|
||||
return {
|
||||
type: actions.ADD_COMMENT_BOX_TAG,
|
||||
tag,
|
||||
};
|
||||
};
|
||||
export const removeCommentBoxTag = idx => {
|
||||
showOldTagsWarningOnce();
|
||||
return {
|
||||
type: actions.REMOVE_COMMENT_BOX_TAG,
|
||||
idx,
|
||||
};
|
||||
};
|
||||
export const clearCommentBoxTags = () => {
|
||||
showOldTagsWarningOnce();
|
||||
return {
|
||||
type: actions.CLEAR_COMMENT_BOX_TAGS,
|
||||
};
|
||||
};
|
||||
// @Deprecated
|
||||
export const removeCommentBoxTag = idx => ({
|
||||
type: actions.REMOVE_COMMENT_BOX_TAG,
|
||||
idx,
|
||||
});
|
||||
|
||||
// @Deprecated
|
||||
export const clearCommentBoxTags = () => ({
|
||||
type: actions.CLEAR_COMMENT_BOX_TAGS,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user