react-code-dataset / wp-calypso /apps /notifications /src /panel /state /selectors /get-is-note-approved.js
react-code-dataset / wp-calypso /apps /notifications /src /panel /state /selectors /get-is-note-approved.js
Download wp-calypso/apps/notifications/src/panel/state/selectors/get-is-note-approved.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 473 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/notifications/src/panel/state/selectors/get-is-note-approved.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/apps/notifications/src/panel/state/selectors/get-is-note-approved.js
-
curl -L -o get-is-note-approved.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/apps/notifications/src/panel/state/selectors/get-is-note-approved.js
473 Bytes
| import { getActions } from '../../helpers/notes'; | |
| import getNotes from './get-notes'; | |
| export const getIsNoteApproved = ( notesState, note ) => { | |
| const noteApprovals = notesState.noteApprovals; | |
| if ( noteApprovals.hasOwnProperty( note.id ) ) { | |
| return noteApprovals[ note.id ]; | |
| } | |
| const actionMeta = getActions( note ); | |
| return actionMeta && true === actionMeta[ 'approve-comment' ]; | |
| }; | |
| export default ( state, note ) => getIsNoteApproved( getNotes( state ), note ); | |