Fix delete conversation action not being reflected in web UI (#12030)

lolsob-rspec
Eugen Rochko 2019-10-01 04:54:17 +02:00 committed by GitHub
parent 67713f8b08
commit 6bf6f5e06c
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import {
CONVERSATIONS_FETCH_FAIL,
CONVERSATIONS_UPDATE,
CONVERSATIONS_READ,
CONVERSATIONS_DELETE_SUCCESS,
} from '../actions/conversations';
import { ACCOUNT_BLOCK_SUCCESS, ACCOUNT_MUTE_SUCCESS } from 'mastodon/actions/accounts';
import { DOMAIN_BLOCK_SUCCESS } from 'mastodon/actions/domain_blocks';
@ -107,6 +108,8 @@ export default function conversations(state = initialState, action) {
return filterConversations(state, [action.relationship.id]);
case DOMAIN_BLOCK_SUCCESS:
return filterConversations(state, action.accounts);
case CONVERSATIONS_DELETE_SUCCESS:
return state.update('items', list => list.filterNot(item => item.get('id') === action.id));
default:
return state;
}