DeliveryIssueDialog: Add learn more button linking to support

This commit is contained in:
Scott Nonnenberg 2021-07-30 13:30:59 -07:00 committed by GitHub
parent d0bf9f929b
commit bf7da5ca2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 515 additions and 89 deletions

View File

@ -10059,9 +10059,20 @@ $contact-modal-padding: 18px;
padding: 3px; padding: 3px;
} }
.module-delivery-issue-dialog__button { .module-delivery-issue-dialog__button {
}
.module-delivery-issue-dialog__learn-more-button {
@include button-reset;
@include button-secondary;
@include font-body-1-bold; @include font-body-1-bold;
border-radius: 4px;
padding: 7px 14px;
}
.module-delivery-issue-dialog__close-button {
@include button-reset; @include button-reset;
@include button-primary; @include button-primary;
@include font-body-1-bold;
border-radius: 4px; border-radius: 4px;
padding: 7px 14px; padding: 7px 14px;

View File

@ -23,7 +23,6 @@ export type Props = {
} & AvatarProps; } & AvatarProps;
export const AvatarPopup = (props: Props): JSX.Element => { export const AvatarPopup = (props: Props): JSX.Element => {
const focusRef = React.useRef<HTMLButtonElement>(null);
const { const {
i18n, i18n,
name, name,
@ -42,7 +41,7 @@ export const AvatarPopup = (props: Props): JSX.Element => {
// Note: mechanisms to dismiss this view are all in its host, MainHeader // Note: mechanisms to dismiss this view are all in its host, MainHeader
// Focus first button after initial render, restore focus on teardown // Focus first button after initial render, restore focus on teardown
useRestoreFocus(focusRef); const [focusRef] = useRestoreFocus();
return ( return (
<div style={style} className="module-avatar-popup"> <div style={style} className="module-avatar-popup">

View File

@ -39,6 +39,7 @@ export function CaptchaDialog(props: Readonly<PropsType>): JSX.Element {
moduleClassName="module-Modal" moduleClassName="module-Modal"
i18n={i18n} i18n={i18n}
title={i18n('CaptchaDialog--can-close__title')} title={i18n('CaptchaDialog--can-close__title')}
onClose={() => setIsClosing(false)}
> >
<section> <section>
<p>{i18n('CaptchaDialog--can-close__body')}</p> <p>{i18n('CaptchaDialog--can-close__body')}</p>

View File

@ -29,6 +29,7 @@ export const NeedsScreenRecordingPermissionsModal = ({
i18n={i18n} i18n={i18n}
title={i18n('calling__presenting--permission-title')} title={i18n('calling__presenting--permission-title')}
theme={Theme.Dark} theme={Theme.Dark}
onClose={toggleScreenRecordingPermissionsDialog}
> >
<p>{i18n('calling__presenting--macos-permission-description')}</p> <p>{i18n('calling__presenting--macos-permission-description')}</p>
<ol style={{ paddingLeft: 16 }}> <ol style={{ paddingLeft: 16 }}>

View File

@ -54,7 +54,7 @@ export const SafetyNumberChangeDialog = ({
if (selectedContact) { if (selectedContact) {
return ( return (
<Modal i18n={i18n}> <Modal i18n={i18n} onClose={onClose}>
{renderSafetyNumber({ contactID: selectedContact.id, onClose })} {renderSafetyNumber({ contactID: selectedContact.id, onClose })}
</Modal> </Modal>
); );

View File

@ -205,12 +205,11 @@ const CALLING_SHORTCUTS: Array<ShortcutType> = [
]; ];
export const ShortcutGuide = (props: Props): JSX.Element => { export const ShortcutGuide = (props: Props): JSX.Element => {
const focusRef = React.useRef<HTMLDivElement>(null);
const { i18n, close, hasInstalledStickers, platform } = props; const { i18n, close, hasInstalledStickers, platform } = props;
const isMacOS = platform === 'darwin'; const isMacOS = platform === 'darwin';
// Restore focus on teardown // Restore focus on teardown
useRestoreFocus(focusRef); const [focusRef] = useRestoreFocus();
return ( return (
<div className="module-shortcut-guide"> <div className="module-shortcut-guide">

View File

@ -6,6 +6,8 @@ import classNames from 'classnames';
import { Modal } from '../Modal'; import { Modal } from '../Modal';
import { useRestoreFocus } from '../../util/hooks';
import { LocalizerType } from '../../types/Util'; import { LocalizerType } from '../../types/Util';
export type PropsType = { export type PropsType = {
@ -19,8 +21,11 @@ export function ChatSessionRefreshedDialog(
): React.ReactElement { ): React.ReactElement {
const { i18n, contactSupport, onClose } = props; const { i18n, contactSupport, onClose } = props;
// Focus first button after initial render, restore focus on teardown
const [focusRef] = useRestoreFocus();
return ( return (
<Modal hasXButton={false} i18n={i18n}> <Modal hasXButton={false} onClose={onClose} i18n={i18n}>
<div className="module-chat-session-refreshed-dialog"> <div className="module-chat-session-refreshed-dialog">
<div className="module-chat-session-refreshed-dialog__image"> <div className="module-chat-session-refreshed-dialog__image">
<img <img
@ -50,6 +55,7 @@ export function ChatSessionRefreshedDialog(
<button <button
type="button" type="button"
onClick={onClose} onClick={onClose}
ref={focusRef}
className="module-chat-session-refreshed-dialog__button" className="module-chat-session-refreshed-dialog__button"
> >
{i18n('Confirmation--confirm')} {i18n('Confirmation--confirm')}

View File

@ -21,6 +21,7 @@ storiesOf('Components/Conversation/DeliveryIssueDialog', module).add(
i18n={i18n} i18n={i18n}
sender={sender} sender={sender}
inGroup={false} inGroup={false}
learnMoreAboutDeliveryIssue={action('learnMoreAboutDeliveryIssue')}
onClose={action('onClose')} onClose={action('onClose')}
/> />
); );
@ -35,6 +36,7 @@ storiesOf('Components/Conversation/DeliveryIssueDialog', module).add(
i18n={i18n} i18n={i18n}
sender={sender} sender={sender}
inGroup inGroup
learnMoreAboutDeliveryIssue={action('learnMoreAboutDeliveryIssue')}
onClose={action('onClose')} onClose={action('onClose')}
/> />
); );

View File

@ -8,24 +8,30 @@ import { Modal } from '../Modal';
import { Intl } from '../Intl'; import { Intl } from '../Intl';
import { Emojify } from './Emojify'; import { Emojify } from './Emojify';
import { useRestoreFocus } from '../../util/hooks';
import { LocalizerType } from '../../types/Util'; import { LocalizerType } from '../../types/Util';
export type PropsType = { export type PropsType = {
i18n: LocalizerType; i18n: LocalizerType;
sender: ConversationType; sender: ConversationType;
inGroup: boolean; inGroup: boolean;
learnMoreAboutDeliveryIssue: () => unknown;
onClose: () => unknown; onClose: () => unknown;
}; };
export function DeliveryIssueDialog(props: PropsType): React.ReactElement { export function DeliveryIssueDialog(props: PropsType): React.ReactElement {
const { i18n, inGroup, sender, onClose } = props; const { i18n, inGroup, learnMoreAboutDeliveryIssue, sender, onClose } = props;
const key = inGroup const key = inGroup
? 'DeliveryIssue--summary--group' ? 'DeliveryIssue--summary--group'
: 'DeliveryIssue--summary'; : 'DeliveryIssue--summary';
// Focus first button after initial render, restore focus on teardown
const [focusRef] = useRestoreFocus();
return ( return (
<Modal hasXButton={false} i18n={i18n}> <Modal hasXButton={false} onClose={onClose} i18n={i18n}>
<div className="module-delivery-issue-dialog"> <div className="module-delivery-issue-dialog">
<div className="module-delivery-issue-dialog__image"> <div className="module-delivery-issue-dialog__image">
<img <img
@ -48,10 +54,18 @@ export function DeliveryIssueDialog(props: PropsType): React.ReactElement {
/> />
</div> </div>
<div className="module-delivery-issue-dialog__buttons"> <div className="module-delivery-issue-dialog__buttons">
<button
type="button"
onClick={learnMoreAboutDeliveryIssue}
className="module-delivery-issue-dialog__learn-more-button"
>
{i18n('DeliveryIssue--learnMore')}
</button>
<button <button
type="button" type="button"
onClick={onClose} onClick={onClose}
className="module-delivery-issue-dialog__button" ref={focusRef}
className="module-delivery-issue-dialog__close-button"
> >
{i18n('Confirmation--confirm')} {i18n('Confirmation--confirm')}
</button> </button>

View File

@ -6,6 +6,7 @@
import * as React from 'react'; import * as React from 'react';
import { storiesOf } from '@storybook/react'; import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../../js/modules/i18n'; import { setup as setupI18n } from '../../../js/modules/i18n';
import enMessages from '../../../_locales/en/messages.json'; import enMessages from '../../../_locales/en/messages.json';
@ -19,7 +20,12 @@ storiesOf('Components/Conversation/DeliveryIssueNotification', module).add(
'Default', 'Default',
() => { () => {
return ( return (
<DeliveryIssueNotification i18n={i18n} inGroup={false} sender={sender} /> <DeliveryIssueNotification
i18n={i18n}
inGroup={false}
learnMoreAboutDeliveryIssue={action('learnMoreAboutDeliveryIssue')}
sender={sender}
/>
); );
} }
); );
@ -27,6 +33,13 @@ storiesOf('Components/Conversation/DeliveryIssueNotification', module).add(
storiesOf('Components/Conversation/DeliveryIssueNotification', module).add( storiesOf('Components/Conversation/DeliveryIssueNotification', module).add(
'In Group', 'In Group',
() => { () => {
return <DeliveryIssueNotification i18n={i18n} inGroup sender={sender} />; return (
<DeliveryIssueNotification
i18n={i18n}
inGroup
learnMoreAboutDeliveryIssue={action('learnMoreAboutDeliveryIssue')}
sender={sender}
/>
);
} }
); );

View File

@ -15,16 +15,22 @@ export type PropsDataType = {
inGroup: boolean; inGroup: boolean;
}; };
export type PropsActionsType = {
learnMoreAboutDeliveryIssue: () => unknown;
};
type PropsHousekeepingType = { type PropsHousekeepingType = {
i18n: LocalizerType; i18n: LocalizerType;
}; };
export type PropsType = PropsDataType & PropsHousekeepingType; export type PropsType = PropsDataType &
PropsActionsType &
PropsHousekeepingType;
export function DeliveryIssueNotification( export function DeliveryIssueNotification(
props: PropsType props: PropsType
): ReactElement | null { ): ReactElement | null {
const { i18n, inGroup, sender } = props; const { i18n, inGroup, sender, learnMoreAboutDeliveryIssue } = props;
const [isDialogOpen, setIsDialogOpen] = useState<boolean>(false); const [isDialogOpen, setIsDialogOpen] = useState<boolean>(false);
const openDialog = useCallback(() => { const openDialog = useCallback(() => {
@ -61,6 +67,7 @@ export function DeliveryIssueNotification(
<DeliveryIssueDialog <DeliveryIssueDialog
i18n={i18n} i18n={i18n}
inGroup={inGroup} inGroup={inGroup}
learnMoreAboutDeliveryIssue={learnMoreAboutDeliveryIssue}
sender={sender} sender={sender}
onClose={closeDialog} onClose={closeDialog}
/> />

View File

@ -40,7 +40,6 @@ export const ReactionPicker = React.forwardRef<HTMLDivElement, Props>(
ref ref
) => { ) => {
const [pickingOther, setPickingOther] = React.useState(false); const [pickingOther, setPickingOther] = React.useState(false);
const focusRef = React.useRef<HTMLButtonElement>(null);
// Handle escape key // Handle escape key
React.useEffect(() => { React.useEffect(() => {
@ -70,7 +69,7 @@ export const ReactionPicker = React.forwardRef<HTMLDivElement, Props>(
); );
// Focus first button and restore focus on unmount // Focus first button and restore focus on unmount
useRestoreFocus(focusRef); const [focusRef] = useRestoreFocus();
const otherSelected = selected && !emojis.includes(selected); const otherSelected = selected && !emojis.includes(selected);

View File

@ -124,8 +124,6 @@ export const ReactionViewer = React.forwardRef<HTMLDivElement, Props>(
selectedReactionCategory, selectedReactionCategory,
setSelectedReactionCategory, setSelectedReactionCategory,
] = React.useState(pickedReaction || 'all'); ] = React.useState(pickedReaction || 'all');
const focusRef = React.useRef<HTMLButtonElement>(null);
// Handle escape key // Handle escape key
React.useEffect(() => { React.useEffect(() => {
const handler = (e: KeyboardEvent) => { const handler = (e: KeyboardEvent) => {
@ -142,7 +140,7 @@ export const ReactionViewer = React.forwardRef<HTMLDivElement, Props>(
}, [onClose]); }, [onClose]);
// Focus first button and restore focus on unmount // Focus first button and restore focus on unmount
useRestoreFocus(focusRef); const [focusRef] = useRestoreFocus();
// If we have previously selected a reaction type that is no longer present // If we have previously selected a reaction type that is no longer present
// (removed on another device, for instance) we should select another // (removed on another device, for instance) we should select another

View File

@ -304,6 +304,7 @@ const actions = () => ({
), ),
setLoadCountdownStart: action('setLoadCountdownStart'), setLoadCountdownStart: action('setLoadCountdownStart'),
setIsNearBottom: action('setIsNearBottom'), setIsNearBottom: action('setIsNearBottom'),
learnMoreAboutDeliveryIssue: action('learnMoreAboutDeliveryIssue'),
loadAndScroll: action('loadAndScroll'), loadAndScroll: action('loadAndScroll'),
loadOlderMessages: action('loadOlderMessages'), loadOlderMessages: action('loadOlderMessages'),
loadNewerMessages: action('loadNewerMessages'), loadNewerMessages: action('loadNewerMessages'),

View File

@ -135,6 +135,7 @@ type PropsActionsType = {
}> }>
) => void; ) => void;
learnMoreAboutDeliveryIssue: () => unknown;
loadAndScroll: (messageId: string) => unknown; loadAndScroll: (messageId: string) => unknown;
loadOlderMessages: (messageId: string) => unknown; loadOlderMessages: (messageId: string) => unknown;
loadNewerMessages: (messageId: string) => unknown; loadNewerMessages: (messageId: string) => unknown;

View File

@ -55,6 +55,7 @@ const getDefaultProps = () => ({
deleteMessage: action('deleteMessage'), deleteMessage: action('deleteMessage'),
deleteMessageForEveryone: action('deleteMessageForEveryone'), deleteMessageForEveryone: action('deleteMessageForEveryone'),
kickOffAttachmentDownload: action('kickOffAttachmentDownload'), kickOffAttachmentDownload: action('kickOffAttachmentDownload'),
learnMoreAboutDeliveryIssue: action('learnMoreAboutDeliveryIssue'),
markAttachmentAsCorrupted: action('markAttachmentAsCorrupted'), markAttachmentAsCorrupted: action('markAttachmentAsCorrupted'),
showMessageDetail: action('showMessageDetail'), showMessageDetail: action('showMessageDetail'),
openConversation: action('openConversation'), openConversation: action('openConversation'),

View File

@ -21,6 +21,7 @@ import {
} from './ChatSessionRefreshedNotification'; } from './ChatSessionRefreshedNotification';
import { import {
DeliveryIssueNotification, DeliveryIssueNotification,
PropsActionsType as DeliveryIssueActionProps,
PropsDataType as DeliveryIssueProps, PropsDataType as DeliveryIssueProps,
} from './DeliveryIssueNotification'; } from './DeliveryIssueNotification';
import { CallingNotificationType } from '../../util/callingNotification'; import { CallingNotificationType } from '../../util/callingNotification';
@ -156,6 +157,7 @@ type PropsLocalType = {
type PropsActionsType = MessageActionsType & type PropsActionsType = MessageActionsType &
CallingNotificationActionsType & CallingNotificationActionsType &
DeliveryIssueActionProps &
PropsChatSessionRefreshedActionsType & PropsChatSessionRefreshedActionsType &
UnsupportedMessageActionsType & UnsupportedMessageActionsType &
SafetyNumberActionsType; SafetyNumberActionsType;
@ -226,7 +228,9 @@ export class TimelineItem extends React.PureComponent<PropsType> {
/> />
); );
} else if (item.type === 'deliveryIssue') { } else if (item.type === 'deliveryIssue') {
notification = <DeliveryIssueNotification {...item.data} i18n={i18n} />; notification = (
<DeliveryIssueNotification {...item.data} {...this.props} i18n={i18n} />
);
} else if (item.type === 'linkNotification') { } else if (item.type === 'linkNotification') {
notification = ( notification = (
<div className="module-message-unsynced"> <div className="module-message-unsynced">

View File

@ -70,7 +70,6 @@ export const StickerPicker = React.memo(
}: Props, }: Props,
ref ref
) => { ) => {
const focusRef = React.useRef<HTMLButtonElement>(null);
const tabIds = React.useMemo( const tabIds = React.useMemo(
() => ['recents', ...packs.map(({ id }) => id)], () => ['recents', ...packs.map(({ id }) => id)],
[packs] [packs]
@ -124,7 +123,7 @@ export const StickerPicker = React.memo(
}, [onClose]); }, [onClose]);
// Focus popup on after initial render, restore focus on teardown // Focus popup on after initial render, restore focus on teardown
useRestoreFocus(focusRef); const [focusRef] = useRestoreFocus();
const isEmpty = stickers.length === 0; const isEmpty = stickers.length === 0;
const addPackRef = isEmpty ? focusRef : undefined; const addPackRef = isEmpty ? focusRef : undefined;

View File

@ -76,12 +76,11 @@ export const StickerPreviewModal = React.memo((props: Props) => {
installStickerPack, installStickerPack,
uninstallStickerPack, uninstallStickerPack,
} = props; } = props;
const focusRef = React.useRef<HTMLButtonElement>(null);
const [root, setRoot] = React.useState<HTMLElement | null>(null); const [root, setRoot] = React.useState<HTMLElement | null>(null);
const [confirmingUninstall, setConfirmingUninstall] = React.useState(false); const [confirmingUninstall, setConfirmingUninstall] = React.useState(false);
// Restore focus on teardown // Restore focus on teardown
useRestoreFocus(focusRef, root); const [focusRef] = useRestoreFocus();
React.useEffect(() => { React.useEffect(() => {
const div = document.createElement('div'); const div = document.createElement('div');

View File

@ -13,34 +13,47 @@ export function usePrevious<T>(initialValue: T, currentValue: T): T {
return result; return result;
} }
type CallbackType = (toFocus: HTMLElement | null | undefined) => void;
// Restore focus on teardown // Restore focus on teardown
export const useRestoreFocus = ( export const useRestoreFocus = (): Array<CallbackType> => {
// The ref for the element to receive initial focus const toFocusRef = React.useRef<HTMLElement | null>(null);
focusRef: React.RefObject<HTMLElement>, const lastFocusedRef = React.useRef<HTMLElement | null>(null);
// Allow for an optional root element that must exist
root: boolean | HTMLElement | null = true // We need to use a callback here because refs aren't necessarily populated on first
): void => { // render. For example, ModalHost makes a top-level parent div first, and then renders
// into it. And the children you pass it don't have access to that root div.
const setFocusRef = React.useCallback(
(toFocus: HTMLElement | null | undefined) => {
if (!toFocus) {
return;
}
// We only want to do this once.
if (toFocusRef.current) {
return;
}
toFocusRef.current = toFocus;
// Remember last-focused element, focus this new target element.
lastFocusedRef.current = document.activeElement as HTMLElement;
toFocus.focus();
},
[]
);
React.useEffect(() => { React.useEffect(() => {
if (!root) {
return undefined;
}
const lastFocused = document.activeElement as HTMLElement;
if (focusRef.current) {
focusRef.current.focus();
}
return () => { return () => {
// This ensures that the focus is returned to // On unmount, returned focus to element focused before we set the focus
// previous element
setTimeout(() => { setTimeout(() => {
if (lastFocused && lastFocused.focus) { if (lastFocusedRef.current && lastFocusedRef.current.focus) {
lastFocused.focus(); lastFocusedRef.current.focus();
} }
}); });
}; };
}, [focusRef, root]); }, []);
return [setFocusRef];
}; };
export const useBoundActions = <T extends ActionCreatorsMapObject>( export const useBoundActions = <T extends ActionCreatorsMapObject>(

View File

@ -13058,6 +13058,13 @@
"reasonCategory": "falseMatch", "reasonCategory": "falseMatch",
"updated": "2018-09-19T21:59:32.770Z" "updated": "2018-09-19T21:59:32.770Z"
}, },
{
"rule": "React-useRef",
"path": "sticker-creator/components/StickerFrame.tsx",
"line": " const timerRef = React.useRef<number>();",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "sticker-creator/util/i18n.tsx", "path": "sticker-creator/util/i18n.tsx",
@ -13184,6 +13191,13 @@
"updated": "2021-01-06T00:47:54.313Z", "updated": "2021-01-06T00:47:54.313Z",
"reasonDetail": "Needed to render remote video elements. Doesn't interact with the DOM." "reasonDetail": "Needed to render remote video elements. Doesn't interact with the DOM."
}, },
{
"rule": "React-useRef",
"path": "ts/calling/useGetCallingFrameBuffer.ts",
"line": " const ref = useRef<ArrayBuffer | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "jQuery-load(", "rule": "jQuery-load(",
"path": "ts/challenge.js", "path": "ts/challenge.js",
@ -13235,6 +13249,20 @@
"updated": "2021-03-01T18:34:36.638Z", "updated": "2021-03-01T18:34:36.638Z",
"reasonDetail": "Used to reference popup menu" "reasonDetail": "Used to reference popup menu"
}, },
{
"rule": "React-useRef",
"path": "ts/components/AvatarInput.tsx",
"line": " const fileInputRef = useRef<null | HTMLInputElement>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/AvatarInput.tsx",
"line": " const menuTriggerRef = useRef<null | any>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/AvatarInputContainer.js", "path": "ts/components/AvatarInputContainer.js",
@ -13244,11 +13272,10 @@
}, },
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/AvatarPopup.js", "path": "ts/components/AvatarInputContainer.tsx",
"line": " const focusRef = React.useRef(null);", "line": " const startingAvatarPathRef = useRef<undefined | string>(avatarPath);",
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2020-10-26T19:12:24.410Z", "updated": "2021-07-30T16:57:33.618Z"
"reasonDetail": "Only used to focus the element."
}, },
{ {
"rule": "React-useRef", "rule": "React-useRef",
@ -13264,6 +13291,20 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-06-09T04:02:08.305Z" "updated": "2021-06-09T04:02:08.305Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/BackboneHost.tsx",
"line": " const hostRef = useRef<HTMLDivElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/BackboneHost.tsx",
"line": " const viewRef = useRef<Backbone.View | undefined>(undefined);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/CallNeedPermissionScreen.js", "path": "ts/components/CallNeedPermissionScreen.js",
@ -13272,6 +13313,13 @@
"updated": "2020-10-26T19:12:24.410Z", "updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Doesn't touch the DOM." "reasonDetail": "Doesn't touch the DOM."
}, },
{
"rule": "React-useRef",
"path": "ts/components/CallNeedPermissionScreen.tsx",
"line": " const autoCloseAtRef = useRef<number>(Date.now() + AUTO_CLOSE_MS);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/CallScreen.js", "path": "ts/components/CallScreen.js",
@ -13280,6 +13328,13 @@
"updated": "2020-10-26T21:35:52.858Z", "updated": "2020-10-26T21:35:52.858Z",
"reasonDetail": "Used to get the local video element for rendering." "reasonDetail": "Used to get the local video element for rendering."
}, },
{
"rule": "React-useRef",
"path": "ts/components/CallScreen.tsx",
"line": " const localVideoRef = useRef<HTMLVideoElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/CallingLobby.js", "path": "ts/components/CallingLobby.js",
@ -13288,6 +13343,13 @@
"updated": "2020-10-26T19:12:24.410Z", "updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Used to get the local video element for rendering." "reasonDetail": "Used to get the local video element for rendering."
}, },
{
"rule": "React-useRef",
"path": "ts/components/CallingLobby.tsx",
"line": " const localVideoRef = React.useRef<null | HTMLVideoElement>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/CallingPip.js", "path": "ts/components/CallingPip.js",
@ -13312,6 +13374,13 @@
"updated": "2020-10-26T19:12:24.410Z", "updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Used to get the local video element for rendering." "reasonDetail": "Used to get the local video element for rendering."
}, },
{
"rule": "React-useRef",
"path": "ts/components/CallingPip.tsx",
"line": " const videoContainerRef = React.useRef<null | HTMLDivElement>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/CallingToastManager.js", "path": "ts/components/CallingToastManager.js",
@ -13319,6 +13388,13 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-05-13T19:40:31.751Z" "updated": "2021-05-13T19:40:31.751Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/CallingToastManager.tsx",
"line": " const timeoutRef = useRef<NodeJS.Timeout | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/CaptchaDialog.js", "path": "ts/components/CaptchaDialog.js",
@ -13327,6 +13403,13 @@
"updated": "2021-05-05T23:11:22.692Z", "updated": "2021-05-05T23:11:22.692Z",
"reasonDetail": "Used only to set focus" "reasonDetail": "Used only to set focus"
}, },
{
"rule": "React-useRef",
"path": "ts/components/CaptchaDialog.tsx",
"line": " const buttonRef = useRef<HTMLButtonElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-createRef", "rule": "React-createRef",
"path": "ts/components/CaptionEditor.js", "path": "ts/components/CaptionEditor.js",
@ -13350,6 +13433,13 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-05-25T18:25:53.896Z" "updated": "2021-05-25T18:25:53.896Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/ChatColorPicker.tsx",
"line": " const menuRef = useRef<any | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "DOM-innerHTML", "rule": "DOM-innerHTML",
"path": "ts/components/CompositionArea.js", "path": "ts/components/CompositionArea.js",
@ -13382,6 +13472,20 @@
"updated": "2020-06-03T19:23:21.195Z", "updated": "2020-06-03T19:23:21.195Z",
"reasonDetail": "Our code, no user input, only clearing out the dom" "reasonDetail": "Our code, no user input, only clearing out the dom"
}, },
{
"rule": "React-useRef",
"path": "ts/components/CompositionArea.tsx",
"line": " const inputApiRef = React.useRef<InputApi | undefined>();",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/CompositionArea.tsx",
"line": " const micCellRef = React.useRef<HTMLDivElement>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/CompositionInput.js", "path": "ts/components/CompositionInput.js",
@ -13444,6 +13548,48 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-04-21T21:35:38.757Z" "updated": "2021-04-21T21:35:38.757Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/CompositionInput.tsx",
"line": " const emojiCompletionRef = React.useRef<EmojiCompletion>();",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/CompositionInput.tsx",
"line": " const mentionCompletionRef = React.useRef<MentionCompletion>();",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/CompositionInput.tsx",
"line": " const quillRef = React.useRef<Quill>();",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/CompositionInput.tsx",
"line": " const scrollerRef = React.useRef<HTMLDivElement>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/CompositionInput.tsx",
"line": " const propsRef = React.useRef<Props>(props);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/CompositionInput.tsx",
"line": " const memberRepositoryRef = React.useRef<MemberRepository>(",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/ContactPills.js", "path": "ts/components/ContactPills.js",
@ -13452,6 +13598,13 @@
"updated": "2021-03-01T18:34:36.638Z", "updated": "2021-03-01T18:34:36.638Z",
"reasonDetail": "Used for scrolling. Doesn't otherwise manipulate the DOM" "reasonDetail": "Used for scrolling. Doesn't otherwise manipulate the DOM"
}, },
{
"rule": "React-useRef",
"path": "ts/components/ContactPills.tsx",
"line": " const elRef = useRef<null | HTMLDivElement>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/ConversationList.js", "path": "ts/components/ConversationList.js",
@ -13460,6 +13613,13 @@
"updated": "2021-02-12T16:25:08.285Z", "updated": "2021-02-12T16:25:08.285Z",
"reasonDetail": "Used for scroll calculations" "reasonDetail": "Used for scroll calculations"
}, },
{
"rule": "React-useRef",
"path": "ts/components/ConversationList.tsx",
"line": " const listRef = useRef<null | List>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/DirectCallRemoteParticipant.js", "path": "ts/components/DirectCallRemoteParticipant.js",
@ -13468,6 +13628,13 @@
"updated": "2020-11-11T21:56:04.179Z", "updated": "2020-11-11T21:56:04.179Z",
"reasonDetail": "Needed to render the remote video element." "reasonDetail": "Needed to render the remote video element."
}, },
{
"rule": "React-useRef",
"path": "ts/components/DirectCallRemoteParticipant.tsx",
"line": " const remoteVideoRef = useRef<HTMLCanvasElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/ForwardMessageModal.js", "path": "ts/components/ForwardMessageModal.js",
@ -13482,6 +13649,20 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-04-19T18:13:21.664Z" "updated": "2021-04-19T18:13:21.664Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/ForwardMessageModal.tsx",
"line": " const inputRef = useRef<null | HTMLInputElement>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/ForwardMessageModal.tsx",
"line": " const inputApiRef = React.useRef<InputApi | undefined>();",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/GradientDial.js", "path": "ts/components/GradientDial.js",
@ -13489,6 +13670,13 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-05-25T18:25:53.896Z" "updated": "2021-05-25T18:25:53.896Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/GradientDial.tsx",
"line": " const containerRef = useRef<HTMLDivElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/GroupCallOverflowArea.js", "path": "ts/components/GroupCallOverflowArea.js",
@ -13497,6 +13685,13 @@
"updated": "2021-01-08T15:48:46.313Z", "updated": "2021-01-08T15:48:46.313Z",
"reasonDetail": "Used to deal with scroll position." "reasonDetail": "Used to deal with scroll position."
}, },
{
"rule": "React-useRef",
"path": "ts/components/GroupCallOverflowArea.tsx",
"line": " const overflowRef = useRef<HTMLDivElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/GroupCallRemoteParticipant.js", "path": "ts/components/GroupCallRemoteParticipant.js",
@ -13529,6 +13724,20 @@
"updated": "2021-06-17T20:46:02.342Z", "updated": "2021-06-17T20:46:02.342Z",
"reasonDetail": "Doesn't reference the DOM." "reasonDetail": "Doesn't reference the DOM."
}, },
{
"rule": "React-useRef",
"path": "ts/components/GroupCallRemoteParticipant.tsx",
"line": " const remoteVideoRef = useRef<HTMLCanvasElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/GroupCallRemoteParticipant.tsx",
"line": " const canvasContextRef = useRef<CanvasRenderingContext2D | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/Inbox.js", "path": "ts/components/Inbox.js",
@ -13543,6 +13752,20 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-06-08T02:49:25.154Z" "updated": "2021-06-08T02:49:25.154Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/Inbox.tsx",
"line": " const hostRef = useRef<HTMLDivElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/Inbox.tsx",
"line": " const viewRef = useRef<InboxViewType | undefined>(undefined);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/Input.js", "path": "ts/components/Input.js",
@ -13564,6 +13787,27 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-07-14T00:50:58.330Z" "updated": "2021-07-14T00:50:58.330Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/Input.tsx",
"line": " const innerRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/Input.tsx",
"line": " const valueOnKeydownRef = useRef<string>(value);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/Input.tsx",
"line": " const selectionStartOnKeydownRef = useRef<number>(value.length);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "jQuery-$(", "rule": "jQuery-$(",
"path": "ts/components/Intl.js", "path": "ts/components/Intl.js",
@ -13624,6 +13868,13 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-07-14T00:50:58.330Z" "updated": "2021-07-14T00:50:58.330Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/ProfileEditor.tsx",
"line": " const focusInputRef = useRef<HTMLInputElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-createRef", "rule": "React-createRef",
"path": "ts/components/SafetyNumberChangeDialog.js", "path": "ts/components/SafetyNumberChangeDialog.js",
@ -13632,14 +13883,6 @@
"updated": "2020-06-23T06:48:06.829Z", "updated": "2020-06-23T06:48:06.829Z",
"reasonDetail": "Used to focus cancel button when dialog opens" "reasonDetail": "Used to focus cancel button when dialog opens"
}, },
{
"rule": "React-useRef",
"path": "ts/components/ShortcutGuide.js",
"line": " const focusRef = React.useRef(null);",
"reasonCategory": "usageTrusted",
"updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Only used to focus the element."
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/Slider.js", "path": "ts/components/Slider.js",
@ -13661,6 +13904,27 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-05-25T18:25:53.896Z" "updated": "2021-05-25T18:25:53.896Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/Slider.tsx",
"line": " const diff = useRef<number>(0);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/Slider.tsx",
"line": " const handleRef = useRef<HTMLDivElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/Slider.tsx",
"line": " const sliderRef = useRef<HTMLDivElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/Tooltip.js", "path": "ts/components/Tooltip.js",
@ -13669,6 +13933,13 @@
"updated": "2020-12-04T00:11:08.128Z", "updated": "2020-12-04T00:11:08.128Z",
"reasonDetail": "Used to add (and remove) event listeners." "reasonDetail": "Used to add (and remove) event listeners."
}, },
{
"rule": "React-useRef",
"path": "ts/components/Tooltip.tsx",
"line": " const wrapperRef = React.useRef<HTMLSpanElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/conversation/ContactModal.js", "path": "ts/components/conversation/ContactModal.js",
@ -13683,6 +13954,20 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2020-11-10T21:27:04.909Z" "updated": "2020-11-10T21:27:04.909Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/conversation/ContactModal.tsx",
"line": " const overlayRef = React.useRef<HTMLElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/conversation/ContactModal.tsx",
"line": " const closeButtonRef = React.useRef<HTMLElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-createRef", "rule": "React-createRef",
"path": "ts/components/conversation/ConversationHeader.js", "path": "ts/components/conversation/ConversationHeader.js",
@ -13723,6 +14008,13 @@
"updated": "2020-10-26T19:12:24.410Z", "updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Doesn't refer to a DOM element." "reasonDetail": "Doesn't refer to a DOM element."
}, },
{
"rule": "React-useRef",
"path": "ts/components/conversation/ConversationHero.tsx",
"line": " const previousHeightRef = useRef<undefined | number>();",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/conversation/GIF.js", "path": "ts/components/conversation/GIF.js",
@ -13731,6 +14023,13 @@
"updated": "2021-04-17T01:47:31.419Z", "updated": "2021-04-17T01:47:31.419Z",
"reasonDetail": "Used for managing playback of GIF video" "reasonDetail": "Used for managing playback of GIF video"
}, },
{
"rule": "React-useRef",
"path": "ts/components/conversation/GIF.tsx",
"line": " const videoRef = useRef<HTMLVideoElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/conversation/GroupDescription.js", "path": "ts/components/conversation/GroupDescription.js",
@ -13738,6 +14037,13 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-05-29T02:15:39.186Z" "updated": "2021-05-29T02:15:39.186Z"
}, },
{
"rule": "React-useRef",
"path": "ts/components/conversation/GroupDescription.tsx",
"line": " const textRef = useRef<HTMLDivElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-createRef", "rule": "React-createRef",
"path": "ts/components/conversation/InlineNotificationWrapper.js", "path": "ts/components/conversation/InlineNotificationWrapper.js",
@ -13810,6 +14116,13 @@
"updated": "2021-03-09T01:19:04.057Z", "updated": "2021-03-09T01:19:04.057Z",
"reasonDetail": "Used for obtanining the bounding box for the container" "reasonDetail": "Used for obtanining the bounding box for the container"
}, },
{
"rule": "React-useRef",
"path": "ts/components/conversation/MessageAudio.tsx",
"line": " const waveformRef = useRef<HTMLDivElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-createRef", "rule": "React-createRef",
"path": "ts/components/conversation/MessageDetail.js", "path": "ts/components/conversation/MessageDetail.js",
@ -13834,22 +14147,6 @@
"updated": "2021-01-20T21:30:08.430Z", "updated": "2021-01-20T21:30:08.430Z",
"reasonDetail": "Doesn't touch the DOM." "reasonDetail": "Doesn't touch the DOM."
}, },
{
"rule": "React-useRef",
"path": "ts/components/conversation/ReactionPicker.js",
"line": " const focusRef = React.useRef(null);",
"reasonCategory": "usageTrusted",
"updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Only used to focus the element."
},
{
"rule": "React-useRef",
"path": "ts/components/conversation/ReactionViewer.js",
"line": " const focusRef = React.useRef(null);",
"reasonCategory": "usageTrusted",
"updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Only used to focus the element."
},
{ {
"rule": "React-createRef", "rule": "React-createRef",
"path": "ts/components/conversation/Timeline.js", "path": "ts/components/conversation/Timeline.js",
@ -13866,6 +14163,13 @@
"updated": "2021-03-11T20:49:17.292Z", "updated": "2021-03-11T20:49:17.292Z",
"reasonDetail": "Used to focus an input." "reasonDetail": "Used to focus an input."
}, },
{
"rule": "React-useRef",
"path": "ts/components/conversation/conversation-details/AddGroupMembersModal/ChooseGroupMembersModal.tsx",
"line": " const inputRef = useRef<null | HTMLInputElement>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.js", "path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.js",
@ -13890,6 +14194,27 @@
"updated": "2021-06-04T14:19:49.714Z", "updated": "2021-06-04T14:19:49.714Z",
"reasonDetail": "Only stores undefined/true/false, not DOM references." "reasonDetail": "Only stores undefined/true/false, not DOM references."
}, },
{
"rule": "React-useRef",
"path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx",
"line": " const focusDescriptionRef = useRef<undefined | boolean>(",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx",
"line": " const startingTitleRef = useRef<string>(externalTitle);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/components/conversation/conversation-details/EditConversationAttributesModal.tsx",
"line": " const startingAvatarPathRef = useRef<undefined | string>(externalAvatarPath);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{ {
"rule": "React-createRef", "rule": "React-createRef",
"path": "ts/components/conversation/media-gallery/MediaGallery.js", "path": "ts/components/conversation/media-gallery/MediaGallery.js",
@ -13914,22 +14239,6 @@
"updated": "2019-11-21T06:13:49.384Z", "updated": "2019-11-21T06:13:49.384Z",
"reasonDetail": "Used for setting focus only" "reasonDetail": "Used for setting focus only"
}, },
{
"rule": "React-useRef",
"path": "ts/components/stickers/StickerPicker.js",
"line": " const focusRef = React.useRef(null);",
"reasonCategory": "usageTrusted",
"updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Only used to focus the element."
},
{
"rule": "React-useRef",
"path": "ts/components/stickers/StickerPreviewModal.js",
"line": " const focusRef = React.useRef(null);",
"reasonCategory": "usageTrusted",
"updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Only used to focus the element."
},
{ {
"rule": "jQuery-append(", "rule": "jQuery-append(",
"path": "ts/logging/debuglogs.js", "path": "ts/logging/debuglogs.js",
@ -14102,5 +14411,49 @@
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2021-03-18T21:41:28.361Z", "updated": "2021-03-18T21:41:28.361Z",
"reasonDetail": "A generic hook. Typically not to be used with non-DOM values." "reasonDetail": "A generic hook. Typically not to be used with non-DOM values."
},
{
"rule": "React-useRef",
"path": "ts/util/hooks.js",
"line": " const toFocusRef = React.useRef(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T01:08:01.309Z",
"reasonDetail": "Used to set focus"
},
{
"rule": "React-useRef",
"path": "ts/util/hooks.js",
"line": " const lastFocusedRef = React.useRef(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T01:08:01.309Z",
"reasonDetail": "Used to store the previous-focused item, again to set focus"
},
{
"rule": "React-useRef",
"path": "ts/util/hooks.ts",
"line": " const previousValueRef = React.useRef<T>(initialValue);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/util/hooks.ts",
"line": " const toFocusRef = React.useRef<HTMLElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/util/hooks.ts",
"line": " const lastFocusedRef = React.useRef<HTMLElement | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
},
{
"rule": "React-useRef",
"path": "ts/util/hooks.ts",
"line": " const unobserveRef = React.useRef<(() => unknown) | null>(null);",
"reasonCategory": "usageTrusted",
"updated": "2021-07-30T16:57:33.618Z"
} }
] ]

View File

@ -137,7 +137,7 @@
}, },
{ {
"name": "React-useRef", "name": "React-useRef",
"expression": "\\buseRef\\(", "expression": "\\buseRef(\\(|<)",
"reason": "Potential XSS", "reason": "Potential XSS",
"excludedModules": ["node_modules/react/", "node_modules/react-dom"] "excludedModules": ["node_modules/react/", "node_modules/react-dom"]
}, },

View File

@ -903,6 +903,10 @@ Whisper.ConversationView = Whisper.View.extend({
this.navigateTo(url); this.navigateTo(url);
}; };
const learnMoreAboutDeliveryIssue = () => {
this.navigateTo('https://support.signal.org/hc/articles/4404859745690');
};
const scrollToQuotedMessage = async (options: any) => { const scrollToQuotedMessage = async (options: any) => {
const { authorId, sentAt } = options; const { authorId, sentAt } = options;
@ -1079,6 +1083,7 @@ Whisper.ConversationView = Whisper.View.extend({
model.acknowledgeGroupMemberNameCollisions(groupNameCollisions); model.acknowledgeGroupMemberNameCollisions(groupNameCollisions);
}, },
contactSupport, contactSupport,
learnMoreAboutDeliveryIssue,
loadNewerMessages, loadNewerMessages,
loadNewestMessages: this.loadNewestMessages.bind(this), loadNewestMessages: this.loadNewestMessages.bind(this),
loadAndScroll: this.loadAndScroll.bind(this), loadAndScroll: this.loadAndScroll.bind(this),