make redux store update on block/unblock

pull/1250/head
Audric Ackermann 5 years ago
parent edc34649a4
commit 8d544a9d87
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -250,7 +250,7 @@
? BlockedNumberController.block(this.id)
: BlockedNumberController.blockGroup(this.id);
await promise;
this.trigger('change');
this.trigger('change', this);
this.messageCollection.forEach(m => m.trigger('change'));
this.updateTextInputState();
},
@ -262,7 +262,7 @@
? BlockedNumberController.unblock(this.id)
: BlockedNumberController.unblockGroup(this.id);
await promise;
this.trigger('change');
this.trigger('change', this);
this.messageCollection.forEach(m => m.trigger('change'));
this.updateTextInputState();
},

@ -11,7 +11,6 @@ import { ContactName } from './conversation/ContactName';
import { TypingAnimation } from './conversation/TypingAnimation';
import { Colors, LocalizerType } from '../types/Util';
import { SessionButton, SessionButtonColor } from './session/SessionButton';
export type PropsData = {
id: string;
@ -181,11 +180,11 @@ export class ConversationListItem extends React.PureComponent<Props> {
{!isPublic && !isRss && !isMe ? (
<MenuItem onClick={blockHandler}>{blockTitle}</MenuItem>
) : null}
{!isPublic && !isRss && !isMe ? (
{/* {!isPublic && !isRss && !isMe ? (
<MenuItem onClick={onChangeNickname}>
{i18n('changeNickname')}
</MenuItem>
) : null}
) : null} */}
{!isPublic && !isRss && !isMe && hasNickname ? (
<MenuItem onClick={onClearNickname}>{i18n('clearNickname')}</MenuItem>
) : null}

@ -54,6 +54,7 @@ export type ConversationType = {
isTyping: boolean;
isSecondary?: boolean;
primaryDevice: string;
isBlocked: boolean;
};
export type ConversationLookupType = {
[key: string]: ConversationType;

@ -11,6 +11,7 @@ import {
import { getIntl, getRegionCode, getUserNumber } from './user';
import { PropsData as ConversationListItemPropsType } from '../../components/ConversationListItem';
import { BlockedNumberController } from '../../util';
export const getConversations = (state: StateType): ConversationsStateType =>
state.conversations;
@ -119,6 +120,16 @@ export const _getLeftPaneLists = (
isSelected: true,
};
}
const isBlocked =
BlockedNumberController.isBlocked(conversation.primaryDevice) ||
BlockedNumberController.isGroupBlocked(conversation.id);
if (isBlocked) {
conversation = {
...conversation,
isBlocked: true,
};
}
// Add Open Group to list as soon as the name has been set
if (

Loading…
Cancel
Save