Skip to content

Commit

Permalink
Remove siteId from spamNote and trashNote actions
Browse files Browse the repository at this point in the history
  • Loading branch information
phcp committed Oct 16, 2024
1 parent ca0b87a commit d2d26f3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { recordTracksEvent } from '../../../helpers/stats';
import { spamNote as spamNoteAction } from '../actions';
import bumpStat from '../utils/bump-stat';

const spamNote = ( note, siteId, restClient ) => ( dispatch ) => {
const spamNote = ( note, restClient ) => ( dispatch ) => {
bumpStat( 'spam-comment' );
recordTracksEvent( 'calypso_notification_note_spam', {
note_type: note.type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { recordTracksEvent } from '../../../helpers/stats';
import { trashNote as trashNoteAction } from '../actions';
import bumpStat from '../utils/bump-stat';

const trashNote = ( note, siteId, restClient ) => ( dispatch ) => {
const trashNote = ( note, restClient ) => ( dispatch ) => {
bumpStat( 'trash-comment' );
recordTracksEvent( 'calypso_notification_note_trash', {
note_type: note.type,
Expand Down
3 changes: 1 addition & 2 deletions apps/notifications/src/panel/templates/button-spam.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useContext } from 'react';
import { connect } from 'react-redux';
import { RestClientContext } from '../Notifications';
import { keys } from '../helpers/input';
import { getReferenceId } from '../helpers/notes';
import { spamNote } from '../state/notes/thunks';
import ActionButton from './action-button';

Expand All @@ -17,7 +16,7 @@ const SpamButton = ( { note, translate, spamNote } ) => {
icon="spam"
isActive={ false }
hotkey={ keys.KEY_S }
onToggle={ () => spamNote( note, getReferenceId( note, 'site' ), restClient ) }
onToggle={ () => spamNote( note, restClient ) }
text={ translate( 'Spam', { context: 'verb: Mark as Spam' } ) }
title={ translate( 'Mark comment as spam', { context: 'verb: imperative' } ) }
/>
Expand Down
3 changes: 1 addition & 2 deletions apps/notifications/src/panel/templates/button-trash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useContext } from 'react';
import { connect } from 'react-redux';
import { RestClientContext } from '../Notifications';
import { keys } from '../helpers/input';
import { getReferenceId } from '../helpers/notes';
import { trashNote } from '../state/notes/thunks';
import ActionButton from './action-button';

Expand All @@ -17,7 +16,7 @@ const TrashButton = ( { note, translate, trashNote } ) => {
icon="trash"
isActive={ false }
hotkey={ keys.KEY_T }
onToggle={ () => trashNote( note, getReferenceId( note, 'site' ), restClient ) }
onToggle={ () => trashNote( note, restClient ) }
text={ translate( 'Trash', { context: 'verb: imperative' } ) }
title={ translate( 'Trash comment', { context: 'verb: imperative' } ) }
/>
Expand Down

0 comments on commit d2d26f3

Please sign in to comment.