A few Delete For Everyone fixes
Co-authored-by: Sidney Keese <sidney@carbonfive.com>
This commit is contained in:
parent
0122cfd22a
commit
492bb283ee
2 changed files with 11 additions and 7 deletions
|
@ -959,7 +959,7 @@
|
|||
"description": "Text shown in the confirmation dialog for deleting a message locally"
|
||||
},
|
||||
"deleteForEveryoneWarning": {
|
||||
"message": "This message will be permanently deleted for everyone in the conversation. Members will be able to see that you deleted a message.",
|
||||
"message": "This message will be deleted for everyone in the conversation if they’re on a recent version of Signal. They will be able to see that you deleted a message.",
|
||||
"description": "Text shown in the confirmation dialog for deleting a message for everyone"
|
||||
},
|
||||
"deleteThisMessage": {
|
||||
|
|
|
@ -237,8 +237,6 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
public constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
const { canDeleteForEveryone } = props;
|
||||
|
||||
this.wideMl = window.matchMedia('(min-width: 926px)');
|
||||
this.wideMl.addEventListener('change', this.handleWideMlChange);
|
||||
|
||||
|
@ -256,14 +254,20 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
isWide: this.wideMl.matches,
|
||||
|
||||
containerWidth: 0,
|
||||
canDeleteForEveryone,
|
||||
canDeleteForEveryone: props.canDeleteForEveryone,
|
||||
};
|
||||
}
|
||||
|
||||
public static getDerivedStateFromProps(props: Props, state: State): State {
|
||||
const newState = {
|
||||
...state,
|
||||
canDeleteForEveryone:
|
||||
props.canDeleteForEveryone && state.canDeleteForEveryone,
|
||||
};
|
||||
|
||||
if (!props.isSelected) {
|
||||
return {
|
||||
...state,
|
||||
...newState,
|
||||
isSelected: false,
|
||||
prevSelectedCounter: 0,
|
||||
};
|
||||
|
@ -274,13 +278,13 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
props.isSelectedCounter !== state.prevSelectedCounter
|
||||
) {
|
||||
return {
|
||||
...state,
|
||||
...newState,
|
||||
isSelected: props.isSelected,
|
||||
prevSelectedCounter: props.isSelectedCounter,
|
||||
};
|
||||
}
|
||||
|
||||
return state;
|
||||
return newState;
|
||||
}
|
||||
|
||||
public handleWideMlChange = (event: MediaQueryListEvent): void => {
|
||||
|
|
Loading…
Reference in a new issue