Compare commits

..

1 Commits

Author SHA1 Message Date
Bilal Qamar
7a54819ca2 feat: upgraded to node v18, added .nvmrc and updated workflows (#471)
* feat: upgraded to node v18, added .nvmrc and updated workflows

* refactor: updated packages

* refactor: resolved eslint issues
2023-06-02 20:35:37 +05:00
2 changed files with 3 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useState } from 'react';
import React, { useContext, useEffect } from 'react';
import camelCase from 'lodash/camelCase';
import { useDispatch, useSelector } from 'react-redux';
@@ -14,7 +14,6 @@ import postsMessages from '../discussions/posts/post-actions-bar/messages';
import { setFilter as setTopicFilter } from '../discussions/topics/data/slices';
const Search = ({ intl }) => {
const [previousSearchValue, setPreviousSearchValue] = useState('');
const dispatch = useDispatch();
const { page } = useContext(DiscussionContext);
const postSearch = useSelector(({ threads }) => threads.filters.search);
@@ -36,7 +35,6 @@ const Search = ({ intl }) => {
dispatch(setSearchQuery(''));
dispatch(setTopicFilter(''));
dispatch(setUsernameSearch(''));
setPreviousSearchValue('');
};
const onChange = (query) => {
@@ -44,7 +42,7 @@ const Search = ({ intl }) => {
};
const onSubmit = (query) => {
if (query === '' || query === previousSearchValue) {
if (query === '') {
return;
}
if (isPostSearch) {
@@ -54,7 +52,6 @@ const Search = ({ intl }) => {
} else if (page === 'learners') {
dispatch(setUsernameSearch(query));
}
setPreviousSearchValue(query);
};
useEffect(() => onClear(), [page]);

View File

@@ -58,9 +58,7 @@ const CommentEditor = ({
const initialValues = {
comment: comment.rawBody,
// eslint-disable-next-line react/prop-types
editReasonCode: comment?.lastEdit?.reasonCode || (
userIsStaff && canDisplayEditReason ? 'violates-guidelines' : undefined
),
editReasonCode: comment?.lastEdit?.reasonCode || (userIsStaff ? 'violates-guidelines' : ''),
};
const handleCloseEditor = (resetForm) => {