conversation_view: Move the last of the small functions to redux
This commit is contained in:
parent
86e92dda51
commit
1a68c3db62
59 changed files with 782 additions and 944 deletions
|
@ -9,21 +9,19 @@ import type { LocalizerType } from '../../types/Util';
|
|||
import { Button, ButtonSize, ButtonVariant } from '../Button';
|
||||
import { SystemMessage } from './SystemMessage';
|
||||
import { ChatSessionRefreshedDialog } from './ChatSessionRefreshedDialog';
|
||||
import { openLinkInWebBrowser } from '../../util/openLinkInWebBrowser';
|
||||
import { mapToSupportLocale } from '../../util/mapToSupportLocale';
|
||||
|
||||
type PropsHousekeepingType = {
|
||||
i18n: LocalizerType;
|
||||
};
|
||||
|
||||
export type PropsActionsType = {
|
||||
contactSupport: () => unknown;
|
||||
};
|
||||
|
||||
export type PropsType = PropsHousekeepingType & PropsActionsType;
|
||||
export type PropsType = PropsHousekeepingType;
|
||||
|
||||
export function ChatSessionRefreshedNotification(
|
||||
props: PropsType
|
||||
): ReactElement {
|
||||
const { contactSupport, i18n } = props;
|
||||
const { i18n } = props;
|
||||
const [isDialogOpen, setIsDialogOpen] = useState<boolean>(false);
|
||||
|
||||
const openDialog = useCallback(() => {
|
||||
|
@ -35,8 +33,15 @@ export function ChatSessionRefreshedNotification(
|
|||
|
||||
const wrappedContactSupport = useCallback(() => {
|
||||
setIsDialogOpen(false);
|
||||
contactSupport();
|
||||
}, [contactSupport, setIsDialogOpen]);
|
||||
|
||||
const baseUrl =
|
||||
'https://support.signal.org/hc/LOCALE/requests/new?desktop&chat_refreshed';
|
||||
const locale = window.getLocale();
|
||||
const supportLocale = mapToSupportLocale(locale);
|
||||
const url = baseUrl.replace('LOCALE', supportLocale);
|
||||
|
||||
openLinkInWebBrowser(url);
|
||||
}, [setIsDialogOpen]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue