[Refactoring] TeactN: addReducer => addActionHandler, getDispatch => getActions
This commit is contained in:
parent
10749c62ca
commit
b025fccf0f
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useEffect } from './lib/teact/teact';
|
import React, { FC, useEffect } from './lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from './modules';
|
import { getActions, withGlobal } from './modules';
|
||||||
|
|
||||||
import { GlobalState } from './global/types';
|
import { GlobalState } from './global/types';
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ import { hasStoredSession } from './util/sessions';
|
|||||||
type StateProps = Pick<GlobalState, 'authState'>;
|
type StateProps = Pick<GlobalState, 'authState'>;
|
||||||
|
|
||||||
const App: FC<StateProps> = ({ authState }) => {
|
const App: FC<StateProps> = ({ authState }) => {
|
||||||
const { disconnect } = getDispatch();
|
const { disconnect } = getActions();
|
||||||
|
|
||||||
const [isInactive, markInactive] = useFlag(false);
|
const [isInactive, markInactive] = useFlag(false);
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { getDispatch, getGlobal } from '../modules';
|
import { getActions, getGlobal } from '../modules';
|
||||||
|
|
||||||
import { DEBUG } from '../config';
|
import { DEBUG } from '../config';
|
||||||
|
|
||||||
@ -10,5 +10,5 @@ if (DEBUG) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!getGlobal().connectionState) {
|
if (!getGlobal().connectionState) {
|
||||||
getDispatch().initApi();
|
getActions().initApi();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useEffect, memo } from '../../lib/teact/teact';
|
import React, { FC, useEffect, memo } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ const Auth: FC<StateProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const {
|
const {
|
||||||
reset, initApi, returnToAuthPhoneNumber, goToAuthQrCode,
|
reset, initApi, returnToAuthPhoneNumber, goToAuthQrCode,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
reset();
|
reset();
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { FormEvent } from 'react';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useState, useEffect, useCallback, memo, useRef,
|
FC, useState, useEffect, useCallback, memo, useRef,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
|
|
||||||
import { IS_TOUCH_ENV } from '../../util/environment';
|
import { IS_TOUCH_ENV } from '../../util/environment';
|
||||||
@ -29,7 +29,7 @@ const AuthCode: FC<StateProps> = ({
|
|||||||
setAuthCode,
|
setAuthCode,
|
||||||
returnToAuthPhoneNumber,
|
returnToAuthPhoneNumber,
|
||||||
clearAuthError,
|
clearAuthError,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useState,
|
FC, memo, useCallback, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ type StateProps = Pick<GlobalState, 'authIsLoading' | 'authError' | 'authHint'>;
|
|||||||
const AuthPassword: FC<StateProps> = ({
|
const AuthPassword: FC<StateProps> = ({
|
||||||
authIsLoading, authError, authHint,
|
authIsLoading, authError, authHint,
|
||||||
}) => {
|
}) => {
|
||||||
const { setAuthPassword, clearAuthError } = getDispatch();
|
const { setAuthPassword, clearAuthError } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const [showPassword, setShowPassword] = useState(false);
|
const [showPassword, setShowPassword] = useState(false);
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import monkeyPath from '../../assets/monkey.svg';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,
|
FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
import { LangCode } from '../../types';
|
import { LangCode } from '../../types';
|
||||||
@ -62,7 +62,7 @@ const AuthPhoneNumber: FC<StateProps> = ({
|
|||||||
clearAuthError,
|
clearAuthError,
|
||||||
goToAuthQrCode,
|
goToAuthQrCode,
|
||||||
setSettingOption,
|
setSettingOption,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import QrCreator from 'qr-creator';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useEffect, useRef, memo, useCallback,
|
FC, useEffect, useRef, memo, useCallback,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
import { LangCode } from '../../types';
|
import { LangCode } from '../../types';
|
||||||
@ -35,7 +35,7 @@ const AuthCode: FC<StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
returnToAuthPhoneNumber,
|
returnToAuthPhoneNumber,
|
||||||
setSettingOption,
|
setSettingOption,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const suggestedLanguage = getSuggestedLanguage();
|
const suggestedLanguage = getSuggestedLanguage();
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { ChangeEvent } from 'react';
|
import { ChangeEvent } from 'react';
|
||||||
import React, { FC, useState, memo } from '../../lib/teact/teact';
|
import React, { FC, useState, memo } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ type StateProps = Pick<GlobalState, 'authIsLoading' | 'authError'>;
|
|||||||
const AuthRegister: FC<StateProps> = ({
|
const AuthRegister: FC<StateProps> = ({
|
||||||
authIsLoading, authError,
|
authIsLoading, authError,
|
||||||
}) => {
|
}) => {
|
||||||
const { signUp, clearAuthError, uploadProfilePhoto } = getDispatch();
|
const { signUp, clearAuthError, uploadProfilePhoto } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const [isButtonShown, setIsButtonShown] = useState(false);
|
const [isButtonShown, setIsButtonShown] = useState(false);
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { GroupCallParticipant } from '../../lib/secret-sauce';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useEffect,
|
FC, memo, useEffect,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiGroupCall } from '../../api/types';
|
import { ApiGroupCall } from '../../api/types';
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ const ActiveCallHeader: FC<StateProps> = ({
|
|||||||
meParticipant,
|
meParticipant,
|
||||||
isGroupCallPanelHidden,
|
isGroupCallPanelHidden,
|
||||||
}) => {
|
}) => {
|
||||||
const { toggleGroupCallPanel } = getDispatch();
|
const { toggleGroupCallPanel } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo, useState } from '../../lib/teact/teact';
|
import React, { FC, memo, useState } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import ConfirmDialog from '../ui/ConfirmDialog';
|
import ConfirmDialog from '../ui/ConfirmDialog';
|
||||||
import Checkbox from '../ui/Checkbox';
|
import Checkbox from '../ui/Checkbox';
|
||||||
@ -25,7 +25,7 @@ const CallFallbackConfirm: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
closeCallFallbackConfirm,
|
closeCallFallbackConfirm,
|
||||||
inviteToCallFallback,
|
inviteToCallFallback,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const [shouldRemove, setShouldRemove] = useState(true);
|
const [shouldRemove, setShouldRemove] = useState(true);
|
||||||
const renderingUserFullName = useCurrentOrPrev(userFullName, true);
|
const renderingUserFullName = useCurrentOrPrev(userFullName, true);
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import {
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useMemo, useRef, useState,
|
FC, memo, useCallback, useEffect, useMemo, useRef, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
import '../../../modules/actions/calls';
|
import '../../../modules/actions/calls';
|
||||||
|
|
||||||
import { IAnchorPosition } from '../../../types';
|
import { IAnchorPosition } from '../../../types';
|
||||||
@ -75,7 +75,7 @@ const GroupCall: FC<OwnProps & StateProps> = ({
|
|||||||
toggleGroupCallPanel,
|
toggleGroupCallPanel,
|
||||||
connectToActiveGroupCall,
|
connectToActiveGroupCall,
|
||||||
playGroupCallSound,
|
playGroupCallSound,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
|
import { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
|
||||||
import React, { FC, memo, useMemo } from '../../../lib/teact/teact';
|
import React, { FC, memo, useMemo } from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
import { selectActiveGroupCall } from '../../../modules/selectors/calls';
|
import { selectActiveGroupCall } from '../../../modules/selectors/calls';
|
||||||
@ -27,7 +27,7 @@ const GroupCallParticipantList: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
createGroupCallInviteLink,
|
createGroupCallInviteLink,
|
||||||
loadMoreGroupCallParticipants,
|
loadMoreGroupCallParticipants,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { GroupCallParticipant } from '../../../lib/secret-sauce';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useState,
|
FC, memo, useCallback, useEffect, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { IAnchorPosition } from '../../../types';
|
import { IAnchorPosition } from '../../../types';
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ const GroupCallParticipantMenu: FC<OwnProps & StateProps> = ({
|
|||||||
toggleGroupCallPanel,
|
toggleGroupCallPanel,
|
||||||
openChat,
|
openChat,
|
||||||
requestToSpeak,
|
requestToSpeak,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const [isDeleteUserModalOpen, openDeleteUserModal, closeDeleteUserModal] = useFlag();
|
const [isDeleteUserModalOpen, openDeleteUserModal, closeDeleteUserModal] = useFlag();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useMemo,
|
FC, memo, useCallback, useEffect, useMemo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiChat, ApiGroupCall, ApiUser } from '../../../api/types';
|
import { ApiChat, ApiGroupCall, ApiUser } from '../../../api/types';
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ const GroupCallTopPane: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
joinGroupCall,
|
joinGroupCall,
|
||||||
subscribeToGroupCallUpdates,
|
subscribeToGroupCallUpdates,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { GroupCallConnectionState } from '../../../lib/secret-sauce';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useEffect, useMemo, useRef, useState,
|
FC, memo, useEffect, useMemo, useRef, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import buildClassName from '../../../util/buildClassName';
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import { vibrateShort } from '../../../util/vibrate';
|
import { vibrateShort } from '../../../util/vibrate';
|
||||||
@ -39,7 +39,7 @@ const MicrophoneButton: FC<StateProps> = ({
|
|||||||
toggleGroupCallMute,
|
toggleGroupCallMute,
|
||||||
requestToSpeak,
|
requestToSpeak,
|
||||||
playGroupCallSound,
|
playGroupCallSound,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const muteMouseDownState = useRef('up');
|
const muteMouseDownState = useRef('up');
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,
|
FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch } from '../../modules';
|
import { getActions } from '../../modules';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApiAudio, ApiMediaFormat, ApiMessage, ApiVoice,
|
ApiAudio, ApiMediaFormat, ApiMessage, ApiVoice,
|
||||||
@ -88,7 +88,7 @@ const Audio: FC<OwnProps> = ({
|
|||||||
const seekerRef = useRef<HTMLDivElement>(null);
|
const seekerRef = useRef<HTMLDivElement>(null);
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const { isRtl } = lang;
|
const { isRtl } = lang;
|
||||||
const dispatch = getDispatch();
|
const dispatch = getActions();
|
||||||
|
|
||||||
const [isActivated, setIsActivated] = useState(false);
|
const [isActivated, setIsActivated] = useState(false);
|
||||||
const shouldLoad = (isActivated || PRELOAD) && lastSyncTime;
|
const shouldLoad = (isActivated || PRELOAD) && lastSyncTime;
|
||||||
@ -171,7 +171,7 @@ const Audio: FC<OwnProps> = ({
|
|||||||
onPlay(message.id, message.chatId);
|
onPlay(message.id, message.chatId);
|
||||||
}
|
}
|
||||||
|
|
||||||
getDispatch().setAudioPlayerOrigin({ origin });
|
getActions().setAudioPlayerOrigin({ origin });
|
||||||
setIsActivated(!isActivated);
|
setIsActivated(!isActivated);
|
||||||
playPause();
|
playPause();
|
||||||
}, [isUploading, isPlaying, isActivated, playPause, onCancelUpload, onPlay, message.id, message.chatId, origin]);
|
}, [isUploading, isPlaying, isActivated, playPause, onCancelUpload, onPlay, message.id, message.chatId, origin]);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect,
|
FC, memo, useCallback, useEffect,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
import { ApiChat, ApiCountryCode, ApiUser } from '../../api/types';
|
import { ApiChat, ApiCountryCode, ApiUser } from '../../api/types';
|
||||||
@ -48,7 +48,7 @@ const ChatExtra: FC<OwnProps & StateProps> = ({
|
|||||||
loadFullUser,
|
loadFullUser,
|
||||||
showNotification,
|
showNotification,
|
||||||
updateChatMutedState,
|
updateChatMutedState,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
id: userId,
|
id: userId,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useCallback } from '../../lib/teact/teact';
|
import React, { FC, useCallback } from '../../lib/teact/teact';
|
||||||
import { getDispatch } from '../../modules';
|
import { getActions } from '../../modules';
|
||||||
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ type OwnProps = {
|
|||||||
const ChatLink: FC<OwnProps> = ({
|
const ChatLink: FC<OwnProps> = ({
|
||||||
className, chatId, children,
|
className, chatId, children,
|
||||||
}) => {
|
}) => {
|
||||||
const { openChat } = getDispatch();
|
const { openChat } = getActions();
|
||||||
|
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
if (chatId) {
|
if (chatId) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useCallback, memo } from '../../lib/teact/teact';
|
import React, { FC, useCallback, memo } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiChat } from '../../api/types';
|
import { ApiChat } from '../../api/types';
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ const DeleteChatModal: FC<OwnProps & StateProps> = ({
|
|||||||
deleteChannel,
|
deleteChannel,
|
||||||
deleteChatUser,
|
deleteChatUser,
|
||||||
blockContact,
|
blockContact,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const chatTitle = getChatTitle(lang, chat);
|
const chatTitle = getChatTitle(lang, chat);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useCallback, memo } from '../../lib/teact/teact';
|
import React, { FC, useCallback, memo } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiMessage } from '../../api/types';
|
import { ApiMessage } from '../../api/types';
|
||||||
import { IAlbum } from '../../types';
|
import { IAlbum } from '../../types';
|
||||||
@ -52,7 +52,7 @@ const DeleteMessageModal: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
deleteMessages,
|
deleteMessages,
|
||||||
deleteScheduledMessages,
|
deleteScheduledMessages,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const handleDeleteMessageForAll = useCallback(() => {
|
const handleDeleteMessageForAll = useCallback(() => {
|
||||||
const messageIds = album?.messages
|
const messageIds = album?.messages
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useCallback, memo, useRef, useEffect, useState,
|
FC, useCallback, memo, useRef, useEffect, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch } from '../../modules';
|
import { getActions } from '../../modules';
|
||||||
|
|
||||||
import { ApiMessage } from '../../api/types';
|
import { ApiMessage } from '../../api/types';
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ const Document: FC<OwnProps> = ({
|
|||||||
onDateClick,
|
onDateClick,
|
||||||
isDownloading,
|
isDownloading,
|
||||||
}) => {
|
}) => {
|
||||||
const dispatch = getDispatch();
|
const dispatch = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
const ref = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { ApiGroupCall } from '../../api/types';
|
|||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
|
||||||
import Link from '../ui/Link';
|
import Link from '../ui/Link';
|
||||||
import { getDispatch } from '../../modules';
|
import { getActions } from '../../modules';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -16,7 +16,7 @@ type OwnProps = {
|
|||||||
const GroupCallLink: FC<OwnProps> = ({
|
const GroupCallLink: FC<OwnProps> = ({
|
||||||
className, groupCall, children,
|
className, groupCall, children,
|
||||||
}) => {
|
}) => {
|
||||||
const { joinGroupCall } = getDispatch();
|
const { joinGroupCall } = getActions();
|
||||||
|
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
if (groupCall) {
|
if (groupCall) {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { MouseEvent as ReactMouseEvent } from 'react';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useEffect, useCallback, memo,
|
FC, useEffect, useCallback, memo,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiChat, ApiTypingStatus } from '../../api/types';
|
import { ApiChat, ApiTypingStatus } from '../../api/types';
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
@ -63,7 +63,7 @@ const GroupChatInfo: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
loadFullChat,
|
loadFullChat,
|
||||||
openMediaViewer,
|
openMediaViewer,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const isSuperGroup = chat && isChatSuperGroup(chat);
|
const isSuperGroup = chat && isChatSuperGroup(chat);
|
||||||
const { id: chatId, isMin, isRestricted } = chat || {};
|
const { id: chatId, isMin, isRestricted } = chat || {};
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useCallback } from '../../lib/teact/teact';
|
import React, { FC, useCallback } from '../../lib/teact/teact';
|
||||||
import { getDispatch } from '../../modules';
|
import { getActions } from '../../modules';
|
||||||
|
|
||||||
import { ApiMessage } from '../../api/types';
|
import { ApiMessage } from '../../api/types';
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ type OwnProps = {
|
|||||||
const MessageLink: FC<OwnProps> = ({
|
const MessageLink: FC<OwnProps> = ({
|
||||||
className, message, children,
|
className, message, children,
|
||||||
}) => {
|
}) => {
|
||||||
const { focusMessage } = getDispatch();
|
const { focusMessage } = getActions();
|
||||||
|
|
||||||
const handleMessageClick = useCallback((): void => {
|
const handleMessageClick = useCallback((): void => {
|
||||||
if (message) {
|
if (message) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useCallback, memo } from '../../lib/teact/teact';
|
import React, { FC, useCallback, memo } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { selectChat, selectIsChatWithSelf, selectUser } from '../../modules/selectors';
|
import { selectChat, selectIsChatWithSelf, selectUser } from '../../modules/selectors';
|
||||||
import {
|
import {
|
||||||
@ -44,7 +44,7 @@ const PinMessageModal: FC<OwnProps & StateProps> = ({
|
|||||||
contactName,
|
contactName,
|
||||||
onClose,
|
onClose,
|
||||||
}) => {
|
}) => {
|
||||||
const { pinMessage } = getDispatch();
|
const { pinMessage } = getActions();
|
||||||
|
|
||||||
const handlePinMessageForAll = useCallback(() => {
|
const handlePinMessageForAll = useCallback(() => {
|
||||||
pinMessage({
|
pinMessage({
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { MouseEvent as ReactMouseEvent } from 'react';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useEffect, useCallback, memo,
|
FC, useEffect, useCallback, memo,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiUser, ApiTypingStatus, ApiUserStatus } from '../../api/types';
|
import { ApiUser, ApiTypingStatus, ApiUserStatus } from '../../api/types';
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
@ -64,7 +64,7 @@ const PrivateChatInfo: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
loadFullUser,
|
loadFullUser,
|
||||||
openMediaViewer,
|
openMediaViewer,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const { id: userId } = user || {};
|
const { id: userId } = user || {};
|
||||||
const fullName = getUserFullName(user);
|
const fullName = getUserFullName(user);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useEffect, useCallback, memo, useState,
|
FC, useEffect, useCallback, memo, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiUser, ApiChat, ApiUserStatus } from '../../api/types';
|
import { ApiUser, ApiChat, ApiUserStatus } from '../../api/types';
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
@ -53,7 +53,7 @@ const ProfileInfo: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
loadFullUser,
|
loadFullUser,
|
||||||
openMediaViewer,
|
openMediaViewer,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { ChangeEvent } from 'react';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useState,
|
FC, memo, useCallback, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch } from '../../modules';
|
import { getActions } from '../../modules';
|
||||||
|
|
||||||
import { ApiReportReason } from '../../api/types';
|
import { ApiReportReason } from '../../api/types';
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ const ReportMessageModal: FC<OwnProps> = ({
|
|||||||
const {
|
const {
|
||||||
reportMessages,
|
reportMessages,
|
||||||
exitMessageSelectMode,
|
exitMessageSelectMode,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const [selectedReason, setSelectedReason] = useState<ApiReportReason>('spam');
|
const [selectedReason, setSelectedReason] = useState<ApiReportReason>('spam');
|
||||||
const [description, setDescription] = useState('');
|
const [description, setDescription] = useState('');
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo, useCallback } from '../../lib/teact/teact';
|
import React, { FC, memo, useCallback } from '../../lib/teact/teact';
|
||||||
import { getDispatch } from '../../modules';
|
import { getActions } from '../../modules';
|
||||||
import convertPunycode from '../../lib/punycode';
|
import convertPunycode from '../../lib/punycode';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -23,7 +23,7 @@ const SafeLink: FC<OwnProps> = ({
|
|||||||
children,
|
children,
|
||||||
isRtl,
|
isRtl,
|
||||||
}) => {
|
}) => {
|
||||||
const { toggleSafeLinkModal, openTelegramLink } = getDispatch();
|
const { toggleSafeLinkModal, openTelegramLink } = getActions();
|
||||||
|
|
||||||
const content = children || text;
|
const content = children || text;
|
||||||
const isNotSafe = url !== content;
|
const isNotSafe = url !== content;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useCallback, memo } from '../../lib/teact/teact';
|
import React, { FC, useCallback, memo } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
import { selectChatMessage } from '../../modules/selectors';
|
import { selectChatMessage } from '../../modules/selectors';
|
||||||
@ -27,7 +27,7 @@ const SeenByModal: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
openChat,
|
openChat,
|
||||||
closeSeenByModal,
|
closeSeenByModal,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useRef,
|
FC, memo, useCallback, useEffect, useRef,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiSticker, ApiStickerSet } from '../../api/types';
|
import { ApiSticker, ApiStickerSet } from '../../api/types';
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ const StickerSetModal: FC<OwnProps & StateProps> = ({
|
|||||||
loadStickers,
|
loadStickers,
|
||||||
toggleStickerSet,
|
toggleStickerSet,
|
||||||
sendMessage,
|
sendMessage,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useEffect } from '../../lib/teact/teact';
|
import React, { FC, useEffect } from '../../lib/teact/teact';
|
||||||
import { getDispatch, getGlobal, withGlobal } from '../../modules';
|
import { getActions, getGlobal, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiMediaFormat } from '../../api/types';
|
import { ApiMediaFormat } from '../../api/types';
|
||||||
import { GlobalState } from '../../global/types';
|
import { GlobalState } from '../../global/types';
|
||||||
@ -85,7 +85,7 @@ const UiLoader: FC<OwnProps & StateProps> = ({
|
|||||||
shouldSkipHistoryAnimations,
|
shouldSkipHistoryAnimations,
|
||||||
leftColumnWidth,
|
leftColumnWidth,
|
||||||
}) => {
|
}) => {
|
||||||
const { setIsUiReady } = getDispatch();
|
const { setIsUiReady } = getActions();
|
||||||
|
|
||||||
const [isReady, markReady] = useFlag();
|
const [isReady, markReady] = useFlag();
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { ApiChat, ApiUser } from '../../api/types';
|
|||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
|
||||||
import Link from '../ui/Link';
|
import Link from '../ui/Link';
|
||||||
import { getDispatch } from '../../modules';
|
import { getActions } from '../../modules';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -16,7 +16,7 @@ type OwnProps = {
|
|||||||
const UserLink: FC<OwnProps> = ({
|
const UserLink: FC<OwnProps> = ({
|
||||||
className, sender, children,
|
className, sender, children,
|
||||||
}) => {
|
}) => {
|
||||||
const { openChat } = getDispatch();
|
const { openChat } = getActions();
|
||||||
|
|
||||||
const handleClick = useCallback(() => {
|
const handleClick = useCallback(() => {
|
||||||
if (sender) {
|
if (sender) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { MouseEvent } from 'react';
|
import { MouseEvent } from 'react';
|
||||||
import React from '../../../lib/teact/teact';
|
import React from '../../../lib/teact/teact';
|
||||||
import { getDispatch } from '../../../modules';
|
import { getActions } from '../../../modules';
|
||||||
|
|
||||||
import { ApiFormattedText, ApiMessageEntity, ApiMessageEntityTypes } from '../../../api/types';
|
import { ApiFormattedText, ApiMessageEntity, ApiMessageEntityTypes } from '../../../api/types';
|
||||||
import renderText, { TextFilter } from './renderText';
|
import renderText, { TextFilter } from './renderText';
|
||||||
@ -454,10 +454,10 @@ function getLinkUrl(entityContent: string, entity: ApiMessageEntity) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleBotCommandClick(e: MouseEvent<HTMLAnchorElement>) {
|
function handleBotCommandClick(e: MouseEvent<HTMLAnchorElement>) {
|
||||||
getDispatch().sendBotCommand({ command: e.currentTarget.innerText });
|
getActions().sendBotCommand({ command: e.currentTarget.innerText });
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleHashtagClick(e: MouseEvent<HTMLAnchorElement>) {
|
function handleHashtagClick(e: MouseEvent<HTMLAnchorElement>) {
|
||||||
getDispatch().setLocalTextSearchQuery({ query: e.currentTarget.innerText });
|
getActions().setLocalTextSearchQuery({ query: e.currentTarget.innerText });
|
||||||
getDispatch().searchTextMessagesLocal();
|
getActions().searchTextMessagesLocal();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import {
|
|||||||
useCallback, useEffect, useRef, useState,
|
useCallback, useEffect, useRef, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import safePlay from '../../../util/safePlay';
|
import safePlay from '../../../util/safePlay';
|
||||||
import { getDispatch } from '../../../modules';
|
import { getActions } from '../../../modules';
|
||||||
import useMedia from '../../../hooks/useMedia';
|
import useMedia from '../../../hooks/useMedia';
|
||||||
import { ActiveEmojiInteraction } from '../../../global/types';
|
import { ActiveEmojiInteraction } from '../../../global/types';
|
||||||
import useFlag from '../../../hooks/useFlag';
|
import useFlag from '../../../hooks/useFlag';
|
||||||
@ -29,7 +29,7 @@ export default function useAnimatedEmoji(
|
|||||||
) {
|
) {
|
||||||
const {
|
const {
|
||||||
interactWithAnimatedEmoji, sendEmojiInteraction, sendWatchingEmojiInteraction,
|
interactWithAnimatedEmoji, sendEmojiInteraction, sendWatchingEmojiInteraction,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const hasEffect = localEffect || emoji;
|
const hasEffect = localEffect || emoji;
|
||||||
const [isAnimationLoaded, markAnimationLoaded] = useFlag();
|
const [isAnimationLoaded, markAnimationLoaded] = useFlag();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useCallback, memo, useMemo, useState,
|
FC, useCallback, memo, useMemo, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiChatFolder } from '../../api/types';
|
import { ApiChatFolder } from '../../api/types';
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ const ChatFolderModal: FC<OwnProps & StateProps> = ({
|
|||||||
onClose,
|
onClose,
|
||||||
onCloseAnimationEnd,
|
onCloseAnimationEnd,
|
||||||
}) => {
|
}) => {
|
||||||
const { editChatFolders } = getDispatch();
|
const { editChatFolders } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useRef, useState,
|
FC, memo, useCallback, useEffect, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { LeftColumnContent, SettingsScreens } from '../../types';
|
import { LeftColumnContent, SettingsScreens } from '../../types';
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ const LeftColumn: FC<StateProps> = ({
|
|||||||
clearTwoFaError,
|
clearTwoFaError,
|
||||||
setLeftColumnWidth,
|
setLeftColumnWidth,
|
||||||
resetLeftColumnWidth,
|
resetLeftColumnWidth,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const resizeRef = useRef<HTMLDivElement>(null);
|
const resizeRef = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useLayoutEffect, useMemo, useRef,
|
FC, memo, useCallback, useLayoutEffect, useMemo, useRef,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, getGlobal, withGlobal } from '../../../modules';
|
import { getActions, getGlobal, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import useLang, { LangFn } from '../../../hooks/useLang';
|
import useLang, { LangFn } from '../../../hooks/useLang';
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ const Chat: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
openChat,
|
openChat,
|
||||||
focusLastMessage,
|
focusLastMessage,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
const ref = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useMemo, useRef,
|
FC, memo, useCallback, useEffect, useMemo, useRef,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiChatFolder } from '../../../api/types';
|
import { ApiChatFolder } from '../../../api/types';
|
||||||
import { SettingsScreens } from '../../../types';
|
import { SettingsScreens } from '../../../types';
|
||||||
@ -51,7 +51,7 @@ const ChatFolders: FC<OwnProps & StateProps> = ({
|
|||||||
loadChatFolders,
|
loadChatFolders,
|
||||||
setActiveChatFolder,
|
setActiveChatFolder,
|
||||||
openChat,
|
openChat,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const transitionRef = useRef<HTMLDivElement>(null);
|
const transitionRef = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useMemo, useEffect,
|
FC, memo, useMemo, useEffect,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch } from '../../../modules';
|
import { getActions } from '../../../modules';
|
||||||
|
|
||||||
import { SettingsScreens } from '../../../types';
|
import { SettingsScreens } from '../../../types';
|
||||||
import { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';
|
import { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer';
|
||||||
@ -41,7 +41,7 @@ const ChatList: FC<OwnProps> = ({
|
|||||||
foldersDispatch,
|
foldersDispatch,
|
||||||
onScreenSelect,
|
onScreenSelect,
|
||||||
}) => {
|
}) => {
|
||||||
const { openChat, openNextChat } = getDispatch();
|
const { openChat, openNextChat } = getActions();
|
||||||
|
|
||||||
const resolvedFolderId = (
|
const resolvedFolderId = (
|
||||||
folderType === 'all' ? ALL_FOLDER_ID : folderType === 'archived' ? ARCHIVED_FOLDER_ID : folderId!
|
folderType === 'all' ? ALL_FOLDER_ID : folderType === 'archived' ? ARCHIVED_FOLDER_ID : folderId!
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useEffect, useCallback, useMemo, memo,
|
FC, useEffect, useCallback, useMemo, memo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiUser, ApiUserStatus } from '../../../api/types';
|
import { ApiUser, ApiUserStatus } from '../../../api/types';
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ const ContactList: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
loadContactList,
|
loadContactList,
|
||||||
openChat,
|
openChat,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// Due to the parent Transition, this component never gets unmounted,
|
// Due to the parent Transition, this component never gets unmounted,
|
||||||
// that's why we use throttled API call on every update.
|
// that's why we use throttled API call on every update.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useMemo,
|
FC, memo, useCallback, useMemo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ISettings, LeftColumnContent } from '../../../types';
|
import { ISettings, LeftColumnContent } from '../../../types';
|
||||||
import { ApiChat } from '../../../api/types';
|
import { ApiChat } from '../../../api/types';
|
||||||
@ -95,7 +95,7 @@ const LeftMainHeader: FC<OwnProps & StateProps> = ({
|
|||||||
setGlobalSearchDate,
|
setGlobalSearchDate,
|
||||||
setSettingOption,
|
setSettingOption,
|
||||||
setGlobalSearchChatId,
|
setGlobalSearchChatId,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const hasMenu = content === LeftColumnContent.ChatList;
|
const hasMenu = content === LeftColumnContent.ChatList;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useCallback, useEffect, useMemo, memo,
|
FC, useCallback, useEffect, useMemo, memo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, getGlobal, withGlobal } from '../../../modules';
|
import { getActions, getGlobal, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiChat } from '../../../api/types';
|
import { ApiChat } from '../../../api/types';
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ const NewChatStep1: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
loadContactList,
|
loadContactList,
|
||||||
setGlobalSearchQuery,
|
setGlobalSearchQuery,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// Due to the parent Transition, this component never gets unmounted,
|
// Due to the parent Transition, this component never gets unmounted,
|
||||||
// that's why we use throttled API call on every update.
|
// that's why we use throttled API call on every update.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useState, useCallback, useEffect, memo,
|
FC, useState, useCallback, useEffect, memo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ChatCreationProgress } from '../../../types';
|
import { ChatCreationProgress } from '../../../types';
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ const NewChatStep2: FC<OwnProps & StateProps > = ({
|
|||||||
const {
|
const {
|
||||||
createGroupChat,
|
createGroupChat,
|
||||||
createChannel,
|
createChannel,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useMemo,
|
FC, memo, useCallback, useMemo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { AudioOrigin, LoadMoreDirection } from '../../../types';
|
import { AudioOrigin, LoadMoreDirection } from '../../../types';
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ const AudioResults: FC<OwnProps & StateProps> = ({
|
|||||||
searchMessagesGlobal,
|
searchMessagesGlobal,
|
||||||
focusMessage,
|
focusMessage,
|
||||||
openAudioPlayer,
|
openAudioPlayer,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const currentType = isVoice ? 'voice' : 'audio';
|
const currentType = isVoice ? 'voice' : 'audio';
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback,
|
FC, memo, useCallback,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus,
|
ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus,
|
||||||
@ -52,7 +52,7 @@ const ChatMessage: FC<OwnProps & StateProps> = ({
|
|||||||
privateChatUser,
|
privateChatUser,
|
||||||
lastSyncTime,
|
lastSyncTime,
|
||||||
}) => {
|
}) => {
|
||||||
const { focusMessage } = getDispatch();
|
const { focusMessage } = getActions();
|
||||||
|
|
||||||
const mediaThumbnail = getMessageMediaThumbDataUri(message);
|
const mediaThumbnail = getMessageMediaThumbDataUri(message);
|
||||||
const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'micro'));
|
const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'micro'));
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useMemo,
|
FC, memo, useCallback, useMemo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiChat, ApiMessage } from '../../../api/types';
|
import { ApiChat, ApiMessage } from '../../../api/types';
|
||||||
import { LoadMoreDirection } from '../../../types';
|
import { LoadMoreDirection } from '../../../types';
|
||||||
@ -45,7 +45,7 @@ const ChatMessageResults: FC<OwnProps & StateProps> = ({
|
|||||||
lastSyncTime,
|
lastSyncTime,
|
||||||
onSearchDateSelect,
|
onSearchDateSelect,
|
||||||
}) => {
|
}) => {
|
||||||
const { searchMessagesGlobal } = getDispatch();
|
const { searchMessagesGlobal } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {
|
const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useMemo, useState,
|
FC, memo, useCallback, useMemo, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, getGlobal, withGlobal } from '../../../modules';
|
import { getActions, getGlobal, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiChat, ApiMessage } from '../../../api/types';
|
import { ApiChat, ApiMessage } from '../../../api/types';
|
||||||
import { LoadMoreDirection } from '../../../types';
|
import { LoadMoreDirection } from '../../../types';
|
||||||
@ -61,7 +61,7 @@ const ChatResults: FC<OwnProps & StateProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const {
|
const {
|
||||||
openChat, addRecentlyFoundChatId, searchMessagesGlobal, setGlobalSearchChatId,
|
openChat, addRecentlyFoundChatId, searchMessagesGlobal, setGlobalSearchChatId,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useMemo, useRef,
|
FC, memo, useCallback, useMemo, useRef,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiMessage } from '../../../api/types';
|
import { ApiMessage } from '../../../api/types';
|
||||||
import { LoadMoreDirection } from '../../../types';
|
import { LoadMoreDirection } from '../../../types';
|
||||||
@ -45,7 +45,7 @@ const FileResults: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
searchMessagesGlobal,
|
searchMessagesGlobal,
|
||||||
focusMessage,
|
focusMessage,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useState, useMemo, useRef,
|
FC, memo, useCallback, useState, useMemo, useRef,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { GlobalSearchContent } from '../../../types';
|
import { GlobalSearchContent } from '../../../types';
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ const LeftSearch: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
setGlobalSearchContent,
|
setGlobalSearchContent,
|
||||||
setGlobalSearchDate,
|
setGlobalSearchDate,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const [activeTab, setActiveTab] = useState(currentContent);
|
const [activeTab, setActiveTab] = useState(currentContent);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useMemo, useRef,
|
FC, memo, useCallback, useMemo, useRef,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { LoadMoreDirection } from '../../../types';
|
import { LoadMoreDirection } from '../../../types';
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ const LinkResults: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
searchMessagesGlobal,
|
searchMessagesGlobal,
|
||||||
focusMessage,
|
focusMessage,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useMemo, useRef,
|
FC, memo, useCallback, useMemo, useRef,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { LoadMoreDirection, MediaViewerOrigin } from '../../../types';
|
import { LoadMoreDirection, MediaViewerOrigin } from '../../../types';
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ const MediaResults: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
searchMessagesGlobal,
|
searchMessagesGlobal,
|
||||||
openMediaViewer,
|
openMediaViewer,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useEffect, useCallback, useRef, memo,
|
FC, useEffect, useCallback, useRef, memo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiUser } from '../../../api/types';
|
import { ApiUser } from '../../../api/types';
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ const RecentContacts: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
loadTopUsers, loadContactList, openChat,
|
loadTopUsers, loadContactList, openChat,
|
||||||
addRecentlyFoundChatId, clearRecentlyFoundChats,
|
addRecentlyFoundChatId, clearRecentlyFoundChats,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const topUsersRef = useRef<HTMLDivElement>(null);
|
const topUsersRef = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useMemo, useState, memo, useRef, useCallback, useEffect,
|
FC, useMemo, useState, memo, useRef, useCallback, useEffect,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiUser } from '../../../api/types';
|
import { ApiUser } from '../../../api/types';
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ const BlockUserModal: FC<OwnProps & StateProps> = ({
|
|||||||
loadContactList,
|
loadContactList,
|
||||||
setUserSearchQuery,
|
setUserSearchQuery,
|
||||||
blockContact,
|
blockContact,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const [filter, setFilter] = useState('');
|
const [filter, setFilter] = useState('');
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo, useCallback } from '../../../lib/teact/teact';
|
import React, { FC, memo, useCallback } from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { SettingsScreens, ISettings } from '../../../types';
|
import { SettingsScreens, ISettings } from '../../../types';
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ const SettingsDataStorage: FC<OwnProps & StateProps> = ({
|
|||||||
canAutoPlayVideos,
|
canAutoPlayVideos,
|
||||||
autoLoadFileMaxSizeMb,
|
autoLoadFileMaxSizeMb,
|
||||||
}) => {
|
}) => {
|
||||||
const { setSettingOption } = getDispatch();
|
const { setSettingOption } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { ChangeEvent } from 'react';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useState, useCallback, memo, useEffect, useMemo,
|
FC, useState, useCallback, memo, useEffect, useMemo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiMediaFormat } from '../../../api/types';
|
import { ApiMediaFormat } from '../../../api/types';
|
||||||
import { ProfileEditProgress, SettingsScreens } from '../../../types';
|
import { ProfileEditProgress, SettingsScreens } from '../../../types';
|
||||||
@ -60,7 +60,7 @@ const SettingsEditProfile: FC<OwnProps & StateProps> = ({
|
|||||||
loadCurrentUser,
|
loadCurrentUser,
|
||||||
updateProfile,
|
updateProfile,
|
||||||
checkUsername,
|
checkUsername,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useCallback, memo, useRef, useState,
|
FC, useCallback, memo, useRef, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { SettingsScreens, ISettings, TimeFormat } from '../../../types';
|
import { SettingsScreens, ISettings, TimeFormat } from '../../../types';
|
||||||
import { ApiSticker, ApiStickerSet } from '../../../api/types';
|
import { ApiSticker, ApiStickerSet } from '../../../api/types';
|
||||||
@ -72,7 +72,7 @@ const SettingsGeneral: FC<OwnProps & StateProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const {
|
const {
|
||||||
setSettingOption,
|
setSettingOption,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const stickerSettingsRef = useRef<HTMLDivElement>(null);
|
const stickerSettingsRef = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useEffect, useCallback, useRef,
|
FC, memo, useEffect, useCallback, useRef,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { SettingsScreens, ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types';
|
import { SettingsScreens, ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types';
|
||||||
import { ApiWallpaper } from '../../../api/types';
|
import { ApiWallpaper } from '../../../api/types';
|
||||||
@ -51,7 +51,7 @@ const SettingsGeneralBackground: FC<OwnProps & StateProps> = ({
|
|||||||
loadWallpapers,
|
loadWallpapers,
|
||||||
uploadWallpaper,
|
uploadWallpaper,
|
||||||
setThemeSettings,
|
setThemeSettings,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const themeRef = useRef<string>();
|
const themeRef = useRef<string>();
|
||||||
themeRef.current = theme;
|
themeRef.current = theme;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { ChangeEvent, MutableRefObject, RefObject } from 'react';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useRef, useState,
|
FC, memo, useCallback, useEffect, useRef, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { SettingsScreens, ThemeKey } from '../../../types';
|
import { SettingsScreens, ThemeKey } from '../../../types';
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ const SettingsGeneralBackground: FC<OwnProps & StateProps> = ({
|
|||||||
theme,
|
theme,
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
}) => {
|
}) => {
|
||||||
const { setThemeSettings } = getDispatch();
|
const { setThemeSettings } = getActions();
|
||||||
|
|
||||||
const themeRef = useRef<string>();
|
const themeRef = useRef<string>();
|
||||||
themeRef.current = theme;
|
themeRef.current = theme;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useMemo, useState,
|
FC, memo, useCallback, useMemo, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch } from '../../../modules';
|
import { getActions } from '../../../modules';
|
||||||
|
|
||||||
import { SettingsScreens } from '../../../types';
|
import { SettingsScreens } from '../../../types';
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ const SettingsHeader: FC<OwnProps> = ({
|
|||||||
const {
|
const {
|
||||||
signOut,
|
signOut,
|
||||||
deleteChatFolder,
|
deleteChatFolder,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const [isSignOutDialogOpen, setIsSignOutDialogOpen] = useState(false);
|
const [isSignOutDialogOpen, setIsSignOutDialogOpen] = useState(false);
|
||||||
const [isDeleteFolderDialogOpen, setIsDeleteFolderDialogOpen] = useState(false);
|
const [isDeleteFolderDialogOpen, setIsDeleteFolderDialogOpen] = useState(false);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useMemo, useState,
|
FC, memo, useCallback, useEffect, useMemo, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ISettings, LangCode, SettingsScreens } from '../../../types';
|
import { ISettings, LangCode, SettingsScreens } from '../../../types';
|
||||||
import { ApiLanguage } from '../../../api/types';
|
import { ApiLanguage } from '../../../api/types';
|
||||||
@ -31,7 +31,7 @@ const SettingsLanguage: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
loadLanguages,
|
loadLanguages,
|
||||||
setSettingOption,
|
setSettingOption,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const [selectedLanguage, setSelectedLanguage] = useState<string>(language);
|
const [selectedLanguage, setSelectedLanguage] = useState<string>(language);
|
||||||
const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();
|
const [isLoading, markIsLoading, unmarkIsLoading] = useFlag();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo, useEffect } from '../../../lib/teact/teact';
|
import React, { FC, memo, useEffect } from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { SettingsScreens } from '../../../types';
|
import { SettingsScreens } from '../../../types';
|
||||||
import { ApiUser } from '../../../api/types';
|
import { ApiUser } from '../../../api/types';
|
||||||
@ -30,7 +30,7 @@ const SettingsMain: FC<OwnProps & StateProps> = ({
|
|||||||
currentUser,
|
currentUser,
|
||||||
lastSyncTime,
|
lastSyncTime,
|
||||||
}) => {
|
}) => {
|
||||||
const { loadProfilePhotos } = getDispatch();
|
const { loadProfilePhotos } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const profileId = currentUser?.id;
|
const profileId = currentUser?.id;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import useDebounce from '../../../hooks/useDebounce';
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect,
|
FC, memo, useCallback, useEffect,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { SettingsScreens } from '../../../types';
|
import { SettingsScreens } from '../../../types';
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ const SettingsNotifications: FC<OwnProps & StateProps> = ({
|
|||||||
updateContactSignUpNotification,
|
updateContactSignUpNotification,
|
||||||
updateNotificationSettings,
|
updateNotificationSettings,
|
||||||
updateWebNotificationSettings,
|
updateWebNotificationSettings,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadNotificationSettings();
|
loadNotificationSettings();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo, useEffect } from '../../../lib/teact/teact';
|
import React, { FC, memo, useEffect } from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { PrivacyVisibility, SettingsScreens } from '../../../types';
|
import { PrivacyVisibility, SettingsScreens } from '../../../types';
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ const SettingsPrivacy: FC<OwnProps & StateProps> = ({
|
|||||||
loadAuthorizations,
|
loadAuthorizations,
|
||||||
loadContentSettings,
|
loadContentSettings,
|
||||||
updateContentSettings,
|
updateContentSettings,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadBlockedContacts();
|
loadBlockedContacts();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useMemo,
|
FC, memo, useCallback, useEffect, useMemo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiSession } from '../../../api/types';
|
import { ApiSession } from '../../../api/types';
|
||||||
import { SettingsScreens } from '../../../types';
|
import { SettingsScreens } from '../../../types';
|
||||||
@ -34,7 +34,7 @@ const SettingsPrivacyActiveSessions: FC<OwnProps & StateProps> = ({
|
|||||||
loadAuthorizations,
|
loadAuthorizations,
|
||||||
terminateAuthorization,
|
terminateAuthorization,
|
||||||
terminateAllAuthorizations,
|
terminateAllAuthorizations,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const [isConfirmTerminateAllDialogOpen, openConfirmTerminateAllDialog, closeConfirmTerminateAllDialog] = useFlag();
|
const [isConfirmTerminateAllDialogOpen, openConfirmTerminateAllDialog, closeConfirmTerminateAllDialog] = useFlag();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback,
|
FC, memo, useCallback,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiChat, ApiCountryCode, ApiUser } from '../../../api/types';
|
import { ApiChat, ApiCountryCode, ApiUser } from '../../../api/types';
|
||||||
import { SettingsScreens } from '../../../types';
|
import { SettingsScreens } from '../../../types';
|
||||||
@ -45,7 +45,7 @@ const SettingsPrivacyBlockedUsers: FC<OwnProps & StateProps> = ({
|
|||||||
blockedIds,
|
blockedIds,
|
||||||
phoneCodeList,
|
phoneCodeList,
|
||||||
}) => {
|
}) => {
|
||||||
const { unblockContact } = getDispatch();
|
const { unblockContact } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const [isBlockUserModalOpen, openBlockUserModal, closeBlockUserModal] = useFlag();
|
const [isBlockUserModalOpen, openBlockUserModal, closeBlockUserModal] = useFlag();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useMemo,
|
FC, memo, useCallback, useMemo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiChat, ApiUser } from '../../../api/types';
|
import { ApiChat, ApiUser } from '../../../api/types';
|
||||||
import { ApiPrivacySettings, SettingsScreens } from '../../../types';
|
import { ApiPrivacySettings, SettingsScreens } from '../../../types';
|
||||||
@ -38,7 +38,7 @@ const SettingsPrivacyVisibility: FC<OwnProps & StateProps> = ({
|
|||||||
blockChatIds,
|
blockChatIds,
|
||||||
chatsById,
|
chatsById,
|
||||||
}) => {
|
}) => {
|
||||||
const { setPrivacyVisibility } = getDispatch();
|
const { setPrivacyVisibility } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useMemo, useState,
|
FC, memo, useCallback, useMemo, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, getGlobal, withGlobal } from '../../../modules';
|
import { getActions, getGlobal, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { GlobalState } from '../../../global/types';
|
import { GlobalState } from '../../../global/types';
|
||||||
import { ApiPrivacySettings, SettingsScreens } from '../../../types';
|
import { ApiPrivacySettings, SettingsScreens } from '../../../types';
|
||||||
@ -39,7 +39,7 @@ const SettingsPrivacyVisibilityExceptionList: FC<OwnProps & StateProps> = ({
|
|||||||
currentUserId,
|
currentUserId,
|
||||||
settings,
|
settings,
|
||||||
}) => {
|
}) => {
|
||||||
const { setPrivacySettings } = getDispatch();
|
const { setPrivacySettings } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo, useCallback } from '../../../lib/teact/teact';
|
import React, { FC, memo, useCallback } from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { SettingsScreens } from '../../../types';
|
import { SettingsScreens } from '../../../types';
|
||||||
import { ApiAvailableReaction } from '../../../api/types';
|
import { ApiAvailableReaction } from '../../../api/types';
|
||||||
@ -27,7 +27,7 @@ const SettingsQuickReaction: FC<OwnProps & StateProps> = ({
|
|||||||
availableReactions,
|
availableReactions,
|
||||||
selectedReaction,
|
selectedReaction,
|
||||||
}) => {
|
}) => {
|
||||||
const { setDefaultReaction } = getDispatch();
|
const { setDefaultReaction } = getActions();
|
||||||
useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.General);
|
useHistoryBack(isActive, onReset, onScreenSelect, SettingsScreens.General);
|
||||||
|
|
||||||
const options = availableReactions?.filter((l) => !l.isInactive).map((l) => {
|
const options = availableReactions?.filter((l) => !l.isInactive).map((l) => {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useMemo, useState,
|
FC, memo, useCallback, useEffect, useMemo, useState,
|
||||||
} from '../../../../lib/teact/teact';
|
} from '../../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../../modules';
|
import { getActions, withGlobal } from '../../../../modules';
|
||||||
|
|
||||||
import { SettingsScreens } from '../../../../types';
|
import { SettingsScreens } from '../../../../types';
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ const SettingsFoldersEdit: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
editChatFolder,
|
editChatFolder,
|
||||||
addChatFolder,
|
addChatFolder,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const [animationData, setAnimationData] = useState<string>();
|
const [animationData, setAnimationData] = useState<string>();
|
||||||
const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);
|
const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useMemo, useCallback, useState, useEffect,
|
FC, memo, useMemo, useCallback, useState, useEffect,
|
||||||
} from '../../../../lib/teact/teact';
|
} from '../../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../../modules';
|
import { getActions, withGlobal } from '../../../../modules';
|
||||||
|
|
||||||
import { ApiChatFolder } from '../../../../api/types';
|
import { ApiChatFolder } from '../../../../api/types';
|
||||||
import { SettingsScreens } from '../../../../types';
|
import { SettingsScreens } from '../../../../types';
|
||||||
@ -51,7 +51,7 @@ const SettingsFoldersMain: FC<OwnProps & StateProps> = ({
|
|||||||
loadRecommendedChatFolders,
|
loadRecommendedChatFolders,
|
||||||
addChatFolder,
|
addChatFolder,
|
||||||
showDialog,
|
showDialog,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const [animationData, setAnimationData] = useState<string>();
|
const [animationData, setAnimationData] = useState<string>();
|
||||||
const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);
|
const [isAnimationLoaded, setIsAnimationLoaded] = useState(false);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect,
|
FC, memo, useCallback, useEffect,
|
||||||
} from '../../../../lib/teact/teact';
|
} from '../../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../../modules';
|
import { getActions, withGlobal } from '../../../../modules';
|
||||||
|
|
||||||
import { GlobalState } from '../../../../global/types';
|
import { GlobalState } from '../../../../global/types';
|
||||||
import { SettingsScreens } from '../../../../types';
|
import { SettingsScreens } from '../../../../types';
|
||||||
@ -48,7 +48,7 @@ const SettingsTwoFa: FC<OwnProps & StateProps> = ({
|
|||||||
updateRecoveryEmail,
|
updateRecoveryEmail,
|
||||||
provideTwoFaEmailCode,
|
provideTwoFaEmailCode,
|
||||||
clearPassword,
|
clearPassword,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (waitingEmailCodeLength) {
|
if (waitingEmailCodeLength) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo, useEffect } from '../../lib/teact/teact';
|
import React, { FC, memo, useEffect } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApiContact, ApiError, ApiInviteInfo, ApiPhoto,
|
ApiContact, ApiError, ApiInviteInfo, ApiPhoto,
|
||||||
@ -27,7 +27,7 @@ const Dialogs: FC<StateProps> = ({ dialogs }) => {
|
|||||||
acceptInviteConfirmation,
|
acceptInviteConfirmation,
|
||||||
sendMessage,
|
sendMessage,
|
||||||
showNotification,
|
showNotification,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
const [isModalOpen, openModal, closeModal] = useFlag();
|
const [isModalOpen, openModal, closeModal] = useFlag();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { FC, memo, useEffect } from '../../lib/teact/teact';
|
import { FC, memo, useEffect } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { Thread } from '../../global/types';
|
import { Thread } from '../../global/types';
|
||||||
import { ApiMediaFormat, ApiMessage } from '../../api/types';
|
import { ApiMediaFormat, ApiMessage } from '../../api/types';
|
||||||
@ -24,7 +24,7 @@ const DownloadManager: FC<StateProps> = ({
|
|||||||
activeDownloads,
|
activeDownloads,
|
||||||
messages,
|
messages,
|
||||||
}) => {
|
}) => {
|
||||||
const { cancelMessageMediaDownload } = getDispatch();
|
const { cancelMessageMediaDownload } = getActions();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Object.entries(activeDownloads).forEach(([chatId, messageIds]) => {
|
Object.entries(activeDownloads).forEach(([chatId, messageIds]) => {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useMemo, useState, memo, useRef, useCallback, useEffect,
|
FC, useMemo, useState, memo, useRef, useCallback, useEffect,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, getGlobal, withGlobal } from '../../modules';
|
import { getActions, getGlobal, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiChat, MAIN_THREAD_ID } from '../../api/types';
|
import { ApiChat, MAIN_THREAD_ID } from '../../api/types';
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ const ForwardPicker: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
setForwardChatId,
|
setForwardChatId,
|
||||||
exitForwardMode,
|
exitForwardMode,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const [filter, setFilter] = useState('');
|
const [filter, setFilter] = useState('');
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo, useCallback } from '../../lib/teact/teact';
|
import React, { FC, memo, useCallback } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ type StateProps = {
|
|||||||
const HistoryCalendar: FC<OwnProps & StateProps> = ({
|
const HistoryCalendar: FC<OwnProps & StateProps> = ({
|
||||||
isOpen, selectedAt,
|
isOpen, selectedAt,
|
||||||
}) => {
|
}) => {
|
||||||
const { searchMessagesByDate, closeHistoryCalendar } = getDispatch();
|
const { searchMessagesByDate, closeHistoryCalendar } = getActions();
|
||||||
|
|
||||||
const handleJumpToDate = useCallback((date: Date) => {
|
const handleJumpToDate = useCallback((date: Date) => {
|
||||||
searchMessagesByDate({ timestamp: date.valueOf() / 1000 });
|
searchMessagesByDate({ timestamp: date.valueOf() / 1000 });
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useEffect, memo, useCallback,
|
FC, useEffect, memo, useCallback,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { LangCode } from '../../types';
|
import { LangCode } from '../../types';
|
||||||
import { ApiMessage, ApiUpdateAuthorizationStateType, ApiUpdateConnectionStateType } from '../../api/types';
|
import { ApiMessage, ApiUpdateAuthorizationStateType, ApiUpdateConnectionStateType } from '../../api/types';
|
||||||
@ -122,7 +122,7 @@ const Main: FC<StateProps> = ({
|
|||||||
openStickerSetShortName,
|
openStickerSetShortName,
|
||||||
checkVersionNotification,
|
checkVersionNotification,
|
||||||
loadAppConfig,
|
loadAppConfig,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
if (DEBUG && !DEBUG_isLogged) {
|
if (DEBUG && !DEBUG_isLogged) {
|
||||||
DEBUG_isLogged = true;
|
DEBUG_isLogged = true;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo } from '../../lib/teact/teact';
|
import React, { FC, memo } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiNotification } from '../../api/types';
|
import { ApiNotification } from '../../api/types';
|
||||||
|
|
||||||
@ -13,7 +13,7 @@ type StateProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Notifications: FC<StateProps> = ({ notifications }) => {
|
const Notifications: FC<StateProps> = ({ notifications }) => {
|
||||||
const { dismissNotification } = getDispatch();
|
const { dismissNotification } = getActions();
|
||||||
|
|
||||||
if (!notifications.length) {
|
if (!notifications.length) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo, useCallback } from '../../lib/teact/teact';
|
import React, { FC, memo, useCallback } from '../../lib/teact/teact';
|
||||||
import { getDispatch } from '../../modules';
|
import { getActions } from '../../modules';
|
||||||
|
|
||||||
import { ensureProtocol } from '../../util/ensureProtocol';
|
import { ensureProtocol } from '../../util/ensureProtocol';
|
||||||
import renderText from '../common/helpers/renderText';
|
import renderText from '../common/helpers/renderText';
|
||||||
@ -13,7 +13,7 @@ export type OwnProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const SafeLinkModal: FC<OwnProps> = ({ url }) => {
|
const SafeLinkModal: FC<OwnProps> = ({ url }) => {
|
||||||
const { toggleSafeLinkModal } = getDispatch();
|
const { toggleSafeLinkModal } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useMemo, useRef, useState,
|
FC, memo, useCallback, useEffect, useMemo, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser,
|
ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser,
|
||||||
@ -101,7 +101,7 @@ const MediaViewer: FC<StateProps> = ({
|
|||||||
openForwardMenu,
|
openForwardMenu,
|
||||||
focusMessage,
|
focusMessage,
|
||||||
toggleChatInfo,
|
toggleChatInfo,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const isOpen = Boolean(avatarOwner || messageId);
|
const isOpen = Boolean(avatarOwner || messageId);
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import React, {
|
|||||||
useCallback,
|
useCallback,
|
||||||
useMemo,
|
useMemo,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiMessage } from '../../api/types';
|
import { ApiMessage } from '../../api/types';
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ const MediaViewerActions: FC<OwnProps & StateProps> = ({
|
|||||||
const {
|
const {
|
||||||
downloadMessageMedia,
|
downloadMessageMedia,
|
||||||
cancelMessageMediaDownload,
|
cancelMessageMediaDownload,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const { loadProgress: downloadProgress } = useMediaWithLoadProgress(
|
const { loadProgress: downloadProgress } = useMediaWithLoadProgress(
|
||||||
message && getMessageMediaHash(message, 'download'),
|
message && getMessageMediaHash(message, 'download'),
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useCallback } from '../../lib/teact/teact';
|
import React, { FC, useCallback } from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiChat, ApiMessage, ApiUser } from '../../api/types';
|
import { ApiChat, ApiMessage, ApiUser } from '../../api/types';
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ const SenderInfo: FC<OwnProps & StateProps> = ({
|
|||||||
closeMediaViewer,
|
closeMediaViewer,
|
||||||
focusMessage,
|
focusMessage,
|
||||||
toggleChatInfo,
|
toggleChatInfo,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const handleFocusMessage = useCallback(() => {
|
const handleFocusMessage = useCallback(() => {
|
||||||
closeMediaViewer();
|
closeMediaViewer();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useCallback, useEffect, useMemo,
|
FC, useCallback, useEffect, useMemo,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { AudioOrigin } from '../../types';
|
import { AudioOrigin } from '../../types';
|
||||||
import {
|
import {
|
||||||
@ -63,7 +63,7 @@ const AudioPlayer: FC<OwnProps & StateProps> = ({
|
|||||||
setAudioPlayerMuted,
|
setAudioPlayerMuted,
|
||||||
focusMessage,
|
focusMessage,
|
||||||
closeAudioPlayer,
|
closeAudioPlayer,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const { audio, voice, video } = getMessageContent(message);
|
const { audio, voice, video } = getMessageContent(message);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useRef,
|
FC, memo, useCallback, useEffect, useRef,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types';
|
import { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types';
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ const ContactGreeting: FC<OwnProps & StateProps> = ({
|
|||||||
loadGreetingStickers,
|
loadGreetingStickers,
|
||||||
sendMessage,
|
sendMessage,
|
||||||
markMessageListRead,
|
markMessageListRead,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useCallback, memo, useEffect,
|
FC, useCallback, memo, useEffect,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../modules/selectors';
|
import { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../modules/selectors';
|
||||||
import {
|
import {
|
||||||
@ -46,7 +46,7 @@ const DeleteSelectedMessageModal: FC<OwnProps & StateProps> = ({
|
|||||||
deleteMessages,
|
deleteMessages,
|
||||||
deleteScheduledMessages,
|
deleteScheduledMessages,
|
||||||
exitMessageSelectMode,
|
exitMessageSelectMode,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const prevIsOpen = usePrevious(isOpen);
|
const prevIsOpen = usePrevious(isOpen);
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,
|
FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ActiveEmojiInteraction } from '../../global/types';
|
import { ActiveEmojiInteraction } from '../../global/types';
|
||||||
import { ApiMediaFormat } from '../../api/types';
|
import { ApiMediaFormat } from '../../api/types';
|
||||||
@ -38,7 +38,7 @@ const EmojiInteractionAnimation: FC<OwnProps & StateProps> = ({
|
|||||||
localEffectAnimation,
|
localEffectAnimation,
|
||||||
activeEmojiInteraction,
|
activeEmojiInteraction,
|
||||||
}) => {
|
}) => {
|
||||||
const { stopActiveEmojiInteraction } = getDispatch();
|
const { stopActiveEmojiInteraction } = getActions();
|
||||||
|
|
||||||
const [isHiding, startHiding] = useFlag(false);
|
const [isHiding, startHiding] = useFlag(false);
|
||||||
const [isPlaying, startPlaying] = useFlag(false);
|
const [isPlaying, startPlaying] = useFlag(false);
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import React, {
|
|||||||
useState,
|
useState,
|
||||||
useEffect,
|
useEffect,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { MessageListType } from '../../global/types';
|
import { MessageListType } from '../../global/types';
|
||||||
import { MAIN_THREAD_ID } from '../../api/types';
|
import { MAIN_THREAD_ID } from '../../api/types';
|
||||||
@ -86,7 +86,7 @@ const HeaderActions: FC<OwnProps & StateProps> = ({
|
|||||||
restartBot,
|
restartBot,
|
||||||
openCallFallbackConfirm,
|
openCallFallbackConfirm,
|
||||||
requestNextManagementScreen,
|
requestNextManagementScreen,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const menuButtonRef = useRef<HTMLButtonElement>(null);
|
const menuButtonRef = useRef<HTMLButtonElement>(null);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useState,
|
FC, memo, useCallback, useEffect, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiChat } from '../../api/types';
|
import { ApiChat } from '../../api/types';
|
||||||
import { IAnchorPosition } from '../../types';
|
import { IAnchorPosition } from '../../types';
|
||||||
@ -94,7 +94,7 @@ const HeaderMenuContainer: FC<OwnProps & StateProps> = ({
|
|||||||
addContact,
|
addContact,
|
||||||
openCallFallbackConfirm,
|
openCallFallbackConfirm,
|
||||||
toggleStatistics,
|
toggleStatistics,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const [isMenuOpen, setIsMenuOpen] = useState(true);
|
const [isMenuOpen, setIsMenuOpen] = useState(true);
|
||||||
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
|
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useMemo, useRef, useState,
|
FC, memo, useCallback, useEffect, useMemo, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, getGlobal, withGlobal } from '../../modules';
|
import { getActions, getGlobal, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID,
|
ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID,
|
||||||
@ -140,7 +140,7 @@ const MessageList: FC<OwnProps & StateProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const {
|
const {
|
||||||
loadViewportMessages, setScrollOffset, loadSponsoredMessages, loadMessageReactions, copyMessagesByIds,
|
loadViewportMessages, setScrollOffset, loadSponsoredMessages, loadMessageReactions, copyMessagesByIds,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import useMessageObservers from './hooks/useMessageObservers';
|
|||||||
import Message from './message/Message';
|
import Message from './message/Message';
|
||||||
import SponsoredMessage from './message/SponsoredMessage';
|
import SponsoredMessage from './message/SponsoredMessage';
|
||||||
import ActionMessage from './ActionMessage';
|
import ActionMessage from './ActionMessage';
|
||||||
import { getDispatch } from '../../modules';
|
import { getActions } from '../../modules';
|
||||||
|
|
||||||
interface OwnProps {
|
interface OwnProps {
|
||||||
chatId: string;
|
chatId: string;
|
||||||
@ -74,7 +74,7 @@ const MessageListContent: FC<OwnProps> = ({
|
|||||||
onFabToggle,
|
onFabToggle,
|
||||||
onNotchToggle,
|
onNotchToggle,
|
||||||
}) => {
|
}) => {
|
||||||
const { openHistoryCalendar } = getDispatch();
|
const { openHistoryCalendar } = getActions();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
observeIntersectionForMedia,
|
observeIntersectionForMedia,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect,
|
FC, memo, useCallback, useEffect,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { MessageListType } from '../../global/types';
|
import { MessageListType } from '../../global/types';
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ const MessageSelectToolbar: FC<OwnProps & StateProps> = ({
|
|||||||
openForwardMenuForSelectedMessages,
|
openForwardMenuForSelectedMessages,
|
||||||
downloadSelectedMessages,
|
downloadSelectedMessages,
|
||||||
copySelectedMessages,
|
copySelectedMessages,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();
|
const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag();
|
||||||
const [isReportModalOpen, openReportModal, closeReportModal] = useFlag();
|
const [isReportModalOpen, openReportModal, closeReportModal] = useFlag();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useEffect, useState, memo, useMemo, useCallback,
|
FC, useEffect, useState, memo, useMemo, useCallback,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types';
|
import { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types';
|
||||||
import {
|
import {
|
||||||
@ -169,7 +169,7 @@ const MiddleColumn: FC<StateProps> = ({
|
|||||||
joinChannel,
|
joinChannel,
|
||||||
sendBotCommand,
|
sendBotCommand,
|
||||||
restartBot,
|
restartBot,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const { width: windowWidth } = useWindowSize();
|
const { width: windowWidth } = useWindowSize();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useRef, useState,
|
FC, memo, useCallback, useEffect, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
import cycleRestrict from '../../util/cycleRestrict';
|
import cycleRestrict from '../../util/cycleRestrict';
|
||||||
|
|
||||||
import { GlobalState, MessageListType } from '../../global/types';
|
import { GlobalState, MessageListType } from '../../global/types';
|
||||||
@ -124,7 +124,7 @@ const MiddleHeader: FC<OwnProps & StateProps> = ({
|
|||||||
loadPinnedMessages,
|
loadPinnedMessages,
|
||||||
toggleLeftColumn,
|
toggleLeftColumn,
|
||||||
exitMessageSelectMode,
|
exitMessageSelectMode,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const isBackButtonActive = useRef(true);
|
const isBackButtonActive = useRef(true);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect,
|
FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiChat } from '../../api/types';
|
import { ApiChat } from '../../api/types';
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ const MobileSearchFooter: FC<StateProps> = ({
|
|||||||
focusMessage,
|
focusMessage,
|
||||||
closeLocalTextSearch,
|
closeLocalTextSearch,
|
||||||
openHistoryCalendar,
|
openHistoryCalendar,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useCallback, memo, useMemo, useEffect, useState, useRef,
|
FC, useCallback, memo, useMemo, useEffect, useState, useRef,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, getGlobal, withGlobal } from '../../modules';
|
import { getActions, getGlobal, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { ApiMessage } from '../../api/types';
|
import { ApiMessage } from '../../api/types';
|
||||||
import { LoadMoreDirection } from '../../types';
|
import { LoadMoreDirection } from '../../types';
|
||||||
@ -49,7 +49,7 @@ const ReactorListModal: FC<OwnProps & StateProps> = ({
|
|||||||
loadReactors,
|
loadReactors,
|
||||||
closeReactorListModal,
|
closeReactorListModal,
|
||||||
openChat,
|
openChat,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
// No need for expensive global updates on users, so we avoid them
|
// No need for expensive global updates on users, so we avoid them
|
||||||
const usersById = getGlobal().users.byId;
|
const usersById = getGlobal().users.byId;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useCallback, memo, useRef,
|
FC, useCallback, memo, useRef,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../modules';
|
import { getActions, withGlobal } from '../../modules';
|
||||||
|
|
||||||
import { MessageListType } from '../../global/types';
|
import { MessageListType } from '../../global/types';
|
||||||
import { MAIN_THREAD_ID } from '../../api/types';
|
import { MAIN_THREAD_ID } from '../../api/types';
|
||||||
@ -36,7 +36,7 @@ const ScrollDownButton: FC<OwnProps & StateProps> = ({
|
|||||||
unreadCount,
|
unreadCount,
|
||||||
withExtraShift,
|
withExtraShift,
|
||||||
}) => {
|
}) => {
|
||||||
const { focusNextReply } = getDispatch();
|
const { focusNextReply } = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, memo, useCallback, useState,
|
FC, memo, useCallback, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { withGlobal, getDispatch } from '../../modules';
|
import { withGlobal, getActions } from '../../modules';
|
||||||
|
|
||||||
import { ApiUser } from '../../api/types';
|
import { ApiUser } from '../../api/types';
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ const UserReportPanel: FC<OwnProps & StateProps> = ({ userId, user }) => {
|
|||||||
reportSpam,
|
reportSpam,
|
||||||
deleteChat,
|
deleteChat,
|
||||||
toggleChatArchived,
|
toggleChatArchived,
|
||||||
} = getDispatch();
|
} = getActions();
|
||||||
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
const [isBlockUserModalOpen, openBlockUserModal, closeBlockUserModal] = useFlag();
|
const [isBlockUserModalOpen, openBlockUserModal, closeBlockUserModal] = useFlag();
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import Menu from '../../ui/Menu';
|
|||||||
import BotCommand from './BotCommand';
|
import BotCommand from './BotCommand';
|
||||||
|
|
||||||
import './BotCommandMenu.scss';
|
import './BotCommandMenu.scss';
|
||||||
import { getDispatch } from '../../../modules';
|
import { getActions } from '../../../modules';
|
||||||
|
|
||||||
export type OwnProps = {
|
export type OwnProps = {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
@ -20,7 +20,7 @@ export type OwnProps = {
|
|||||||
const BotCommandMenu: FC<OwnProps> = ({
|
const BotCommandMenu: FC<OwnProps> = ({
|
||||||
isOpen, botCommands, onClose,
|
isOpen, botCommands, onClose,
|
||||||
}) => {
|
}) => {
|
||||||
const { sendBotCommand } = getDispatch();
|
const { sendBotCommand } = getActions();
|
||||||
|
|
||||||
const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, IS_SINGLE_COLUMN_LAYOUT);
|
const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, IS_SINGLE_COLUMN_LAYOUT);
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, {
|
import React, {
|
||||||
FC, useCallback, useEffect, useRef, memo,
|
FC, useCallback, useEffect, useRef, memo,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiBotCommand, ApiUser } from '../../../api/types';
|
import { ApiBotCommand, ApiUser } from '../../../api/types';
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ const BotCommandTooltip: FC<OwnProps & StateProps> = ({
|
|||||||
onClick,
|
onClick,
|
||||||
onClose,
|
onClose,
|
||||||
}) => {
|
}) => {
|
||||||
const { sendBotCommand } = getDispatch();
|
const { sendBotCommand } = getActions();
|
||||||
|
|
||||||
// eslint-disable-next-line no-null/no-null
|
// eslint-disable-next-line no-null/no-null
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, memo, useEffect } from '../../../lib/teact/teact';
|
import React, { FC, memo, useEffect } from '../../../lib/teact/teact';
|
||||||
import { getDispatch, withGlobal } from '../../../modules';
|
import { getActions, withGlobal } from '../../../modules';
|
||||||
|
|
||||||
import { ApiMessage } from '../../../api/types';
|
import { ApiMessage } from '../../../api/types';
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ type StateProps = {
|
|||||||
const BotKeyboardMenu: FC<OwnProps & StateProps> = ({
|
const BotKeyboardMenu: FC<OwnProps & StateProps> = ({
|
||||||
isOpen, message, onClose,
|
isOpen, message, onClose,
|
||||||
}) => {
|
}) => {
|
||||||
const { clickInlineButton } = getDispatch();
|
const { clickInlineButton } = getActions();
|
||||||
|
|
||||||
const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);
|
const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose);
|
||||||
const { isKeyboardSingleUse } = message || {};
|
const { isKeyboardSingleUse } = message || {};
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user