Modern profile sharing in 1:1 and GroupV1 groups

This commit is contained in:
Scott Nonnenberg 2020-10-16 11:31:57 -07:00
parent 60f2422e2a
commit 04b7a29229
22 changed files with 371 additions and 115 deletions

View file

@ -1,15 +1,18 @@
import { LocalizerType } from '../types/Util';
import { ConversationType } from '../state/ducks/conversations';
export type ProfileNameChangeType = {
type: 'name';
oldName: string;
newName: string;
};
type ContactType = {
title: string;
name?: string;
};
export function getStringForProfileChange(
change: ProfileNameChangeType,
changedContact: ConversationType,
changedContact: ContactType,
i18n: LocalizerType
): string {
if (change.type === 'name') {

View file

@ -13120,7 +13120,7 @@
"rule": "DOM-innerHTML",
"path": "ts/components/CompositionArea.js",
"line": " el.innerHTML = '';",
"lineNumber": 24,
"lineNumber": 25,
"reasonCategory": "usageTrusted",
"updated": "2020-05-20T20:10:43.540Z",
"reasonDetail": "Our code, no user input, only clearing out the dom"
@ -13129,7 +13129,7 @@
"rule": "DOM-innerHTML",
"path": "ts/components/CompositionArea.tsx",
"line": " el.innerHTML = '';",
"lineNumber": 78,
"lineNumber": 81,
"reasonCategory": "usageTrusted",
"updated": "2020-06-03T19:23:21.195Z",
"reasonDetail": "Our code, no user input, only clearing out the dom"
@ -13305,7 +13305,7 @@
"rule": "React-createRef",
"path": "ts/components/conversation/Message.tsx",
"line": " public audioRef: React.RefObject<HTMLAudioElement> = React.createRef();",
"lineNumber": 217,
"lineNumber": 218,
"reasonCategory": "usageTrusted",
"updated": "2020-09-08T20:19:01.913Z"
},
@ -13313,7 +13313,7 @@
"rule": "React-createRef",
"path": "ts/components/conversation/Message.tsx",
"line": " public focusRef: React.RefObject<HTMLDivElement> = React.createRef();",
"lineNumber": 219,
"lineNumber": 220,
"reasonCategory": "usageTrusted",
"updated": "2020-09-08T20:19:01.913Z"
},
@ -13321,7 +13321,7 @@
"rule": "React-createRef",
"path": "ts/components/conversation/Message.tsx",
"line": " > = React.createRef();",
"lineNumber": 223,
"lineNumber": 224,
"reasonCategory": "usageTrusted",
"updated": "2020-08-28T19:36:40.817Z"
},
@ -13548,4 +13548,4 @@
"reasonCategory": "falseMatch",
"updated": "2020-09-08T23:07:22.682Z"
}
]
]

View file

@ -1,7 +1,5 @@
import { ColorType } from '../types/Colors';
// import { missingCaseError } from './missingCaseError';
type OldColorType =
| 'amber'
| 'blue'
@ -22,9 +20,11 @@ type OldColorType =
| 'red'
| 'teal'
| 'yellow'
| 'ultramarine';
| 'ultramarine'
| string
| undefined;
export function migrateColor(color: OldColorType): ColorType {
export function migrateColor(color?: OldColorType): ColorType {
switch (color) {
// These colors no longer exist
case 'orange':
@ -62,10 +62,6 @@ export function migrateColor(color: OldColorType): ColorType {
case 'ultramarine':
return color;
// Can uncomment this to ensure that we've covered all potential cases
// default:
// throw missingCaseError(color);
default:
return 'grey';
}