Support for creating New Groups

This commit is contained in:
Evan Hahn 2021-03-03 14:09:58 -06:00 committed by Josh Perez
parent 1934120e46
commit 5de4babc0d
56 changed files with 6222 additions and 526 deletions

View file

@ -14461,6 +14461,24 @@
"updated": "2021-01-06T00:47:54.313Z",
"reasonDetail": "Needed to render remote video elements. Doesn't interact with the DOM."
},
{
"rule": "React-useRef",
"path": "ts/components/AvatarInput.js",
"line": " const fileInputRef = react_1.useRef(null);",
"lineNumber": 40,
"reasonCategory": "usageTrusted",
"updated": "2021-03-01T18:34:36.638Z",
"reasonDetail": "Needed to trigger a click on a 'file' input. Doesn't update the DOM."
},
{
"rule": "React-useRef",
"path": "ts/components/AvatarInput.js",
"line": " const menuTriggerRef = react_1.useRef(null);",
"lineNumber": 43,
"reasonCategory": "usageTrusted",
"updated": "2021-03-01T18:34:36.638Z",
"reasonDetail": "Used to reference popup menu"
},
{
"rule": "React-useRef",
"path": "ts/components/AvatarPopup.js",
@ -14641,11 +14659,29 @@
"updated": "2020-10-26T23:56:13.482Z",
"reasonDetail": "Doesn't refer to a DOM element."
},
{
"rule": "React-useRef",
"path": "ts/components/ContactPills.js",
"line": " const elRef = react_1.useRef(null);",
"lineNumber": 27,
"reasonCategory": "usageTrusted",
"updated": "2021-03-01T18:34:36.638Z",
"reasonDetail": "Used for scrolling. Doesn't otherwise manipulate the DOM"
},
{
"rule": "React-useRef",
"path": "ts/components/ContactPills.js",
"line": " const previousChildCountRef = react_1.useRef(childCount);",
"lineNumber": 29,
"reasonCategory": "usageTrusted",
"updated": "2021-03-01T18:34:36.638Z",
"reasonDetail": "Doesn't reference the DOM. Refers to a number"
},
{
"rule": "React-useRef",
"path": "ts/components/ConversationList.js",
"line": " const listRef = react_1.useRef(null);",
"lineNumber": 44,
"lineNumber": 49,
"reasonCategory": "usageTrusted",
"updated": "2021-02-12T16:25:08.285Z",
"reasonDetail": "Used for scroll calculations"
@ -14706,7 +14742,7 @@
"rule": "React-useRef",
"path": "ts/components/LeftPane.js",
"line": " const previousModeSpecificPropsRef = react_1.useRef(modeSpecificProps);",
"lineNumber": 47,
"lineNumber": 52,
"reasonCategory": "usageTrusted",
"updated": "2021-02-12T16:25:08.285Z",
"reasonDetail": "Doesn't interact with the DOM."
@ -14715,7 +14751,7 @@
"rule": "React-useRef",
"path": "ts/components/LeftPane.tsx",
"line": " const previousModeSpecificPropsRef = useRef(modeSpecificProps);",
"lineNumber": 104,
"lineNumber": 143,
"reasonCategory": "usageTrusted",
"updated": "2021-02-12T16:25:08.285Z",
"reasonDetail": "Doesn't interact with the DOM."
@ -14969,7 +15005,7 @@
"rule": "React-createRef",
"path": "ts/components/conversation/Timeline.js",
"line": " this.listRef = react_1.default.createRef();",
"lineNumber": 31,
"lineNumber": 32,
"reasonCategory": "usageTrusted",
"updated": "2019-07-31T00:19:18.696Z",
"reasonDetail": "Timeline needs to interact with its child List directly"

View file

@ -0,0 +1,24 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function parseIntOrThrow(value: unknown, message: string): number {
let result: number;
switch (typeof value) {
case 'number':
result = value;
break;
case 'string':
result = parseInt(value, 10);
break;
default:
result = NaN;
break;
}
if (!Number.isInteger(result)) {
throw new Error(message);
}
return result;
}

View file

@ -0,0 +1,12 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { parseIntOrThrow } from './parseIntOrThrow';
export function parseIntWithFallback(value: unknown, fallback: number): number {
try {
return parseIntOrThrow(value, 'Failed to parse');
} catch (err) {
return fallback;
}
}