diff --git a/src/App.tsx b/src/App.tsx index 3236e73a1..a8ebd651f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ -import { FC, useEffect } from './lib/teact/teact'; -import React, { getDispatch, withGlobal } from './lib/teact/teactn'; +import React, { FC, useEffect } from './lib/teact/teact'; +import { getDispatch, withGlobal } from './modules'; import { GlobalState } from './global/types'; diff --git a/src/bundles/main.ts b/src/bundles/main.ts index 8e49796d9..4e84b68bc 100644 --- a/src/bundles/main.ts +++ b/src/bundles/main.ts @@ -1,4 +1,4 @@ -import { getDispatch, getGlobal } from '../lib/teact/teactn'; +import { getDispatch, getGlobal } from '../modules'; import { DEBUG } from '../config'; diff --git a/src/components/auth/Auth.tsx b/src/components/auth/Auth.tsx index ad0e40604..67e4aa787 100644 --- a/src/components/auth/Auth.tsx +++ b/src/components/auth/Auth.tsx @@ -1,5 +1,5 @@ import React, { FC, useEffect, memo } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; diff --git a/src/components/auth/AuthCode.tsx b/src/components/auth/AuthCode.tsx index fc9fdfd2f..797a17ed0 100644 --- a/src/components/auth/AuthCode.tsx +++ b/src/components/auth/AuthCode.tsx @@ -2,7 +2,7 @@ import { FormEvent } from 'react'; import React, { FC, useState, useEffect, useCallback, memo, useRef, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; import { IS_TOUCH_ENV } from '../../util/environment'; diff --git a/src/components/auth/AuthPassword.tsx b/src/components/auth/AuthPassword.tsx index 2287b79fc..b487d3a3c 100644 --- a/src/components/auth/AuthPassword.tsx +++ b/src/components/auth/AuthPassword.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; diff --git a/src/components/auth/AuthPhoneNumber.tsx b/src/components/auth/AuthPhoneNumber.tsx index 3010a8caf..82d71d87e 100644 --- a/src/components/auth/AuthPhoneNumber.tsx +++ b/src/components/auth/AuthPhoneNumber.tsx @@ -5,7 +5,7 @@ import monkeyPath from '../../assets/monkey.svg'; import React, { FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; import { LangCode } from '../../types'; diff --git a/src/components/auth/AuthQrCode.tsx b/src/components/auth/AuthQrCode.tsx index 267128323..dceb86531 100644 --- a/src/components/auth/AuthQrCode.tsx +++ b/src/components/auth/AuthQrCode.tsx @@ -2,7 +2,7 @@ import QrCreator from 'qr-creator'; import React, { FC, useEffect, useRef, memo, useCallback, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; import { LangCode } from '../../types'; diff --git a/src/components/auth/AuthRegister.tsx b/src/components/auth/AuthRegister.tsx index 86b3f6d85..067513951 100644 --- a/src/components/auth/AuthRegister.tsx +++ b/src/components/auth/AuthRegister.tsx @@ -1,6 +1,6 @@ import { ChangeEvent } from 'react'; import React, { FC, useState, memo } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; diff --git a/src/components/auth/CountryCodeInput.tsx b/src/components/auth/CountryCodeInput.tsx index fb24a0211..655c55347 100644 --- a/src/components/auth/CountryCodeInput.tsx +++ b/src/components/auth/CountryCodeInput.tsx @@ -1,7 +1,7 @@ import React, { FC, useState, memo, useCallback, useRef, } from '../../lib/teact/teact'; -import { withGlobal } from '../../lib/teact/teactn'; +import { withGlobal } from '../../modules'; import { ApiCountryCode } from '../../api/types'; diff --git a/src/components/calls/ActiveCallHeader.tsx b/src/components/calls/ActiveCallHeader.tsx index e9f04961e..45853a37e 100644 --- a/src/components/calls/ActiveCallHeader.tsx +++ b/src/components/calls/ActiveCallHeader.tsx @@ -2,7 +2,7 @@ import { GroupCallParticipant } from '../../lib/secret-sauce'; import React, { FC, memo, useEffect, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiGroupCall } from '../../api/types'; diff --git a/src/components/calls/CallFallbackConfirm.tsx b/src/components/calls/CallFallbackConfirm.tsx index ac7b058ee..9e3414bfb 100644 --- a/src/components/calls/CallFallbackConfirm.tsx +++ b/src/components/calls/CallFallbackConfirm.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useState } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import ConfirmDialog from '../ui/ConfirmDialog'; import Checkbox from '../ui/Checkbox'; diff --git a/src/components/calls/group/GroupCall.tsx b/src/components/calls/group/GroupCall.tsx index 5f859c2c6..2caf9c170 100644 --- a/src/components/calls/group/GroupCall.tsx +++ b/src/components/calls/group/GroupCall.tsx @@ -5,7 +5,7 @@ import { import React, { FC, memo, useCallback, useEffect, useMemo, useRef, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import '../../../modules/actions/calls'; import { IAnchorPosition } from '../../../types'; diff --git a/src/components/calls/group/GroupCallParticipant.tsx b/src/components/calls/group/GroupCallParticipant.tsx index 908333a67..3d499be84 100644 --- a/src/components/calls/group/GroupCallParticipant.tsx +++ b/src/components/calls/group/GroupCallParticipant.tsx @@ -2,7 +2,7 @@ import { GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../ import React, { FC, memo, useMemo, useRef, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../lib/teact/teactn'; +import { withGlobal } from '../../../modules'; import { ApiChat, ApiUser } from '../../../api/types'; diff --git a/src/components/calls/group/GroupCallParticipantList.tsx b/src/components/calls/group/GroupCallParticipantList.tsx index bd3359c59..15d2081a2 100644 --- a/src/components/calls/group/GroupCallParticipantList.tsx +++ b/src/components/calls/group/GroupCallParticipantList.tsx @@ -1,6 +1,6 @@ import { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce'; import React, { FC, memo, useMemo } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import useLang from '../../../hooks/useLang'; import { selectActiveGroupCall } from '../../../modules/selectors/calls'; diff --git a/src/components/calls/group/GroupCallParticipantMenu.tsx b/src/components/calls/group/GroupCallParticipantMenu.tsx index d42a06e9e..10f4cd2ec 100644 --- a/src/components/calls/group/GroupCallParticipantMenu.tsx +++ b/src/components/calls/group/GroupCallParticipantMenu.tsx @@ -2,7 +2,7 @@ import { GroupCallParticipant } from '../../../lib/secret-sauce'; import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { IAnchorPosition } from '../../../types'; diff --git a/src/components/calls/group/GroupCallParticipantStreams.tsx b/src/components/calls/group/GroupCallParticipantStreams.tsx index 58f1d7250..cd497f88a 100644 --- a/src/components/calls/group/GroupCallParticipantStreams.tsx +++ b/src/components/calls/group/GroupCallParticipantStreams.tsx @@ -2,7 +2,7 @@ import { GroupCallParticipant } from '../../../lib/secret-sauce'; import React, { FC, memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../lib/teact/teactn'; +import { withGlobal } from '../../../modules'; import GroupCallParticipantVideo from './GroupCallParticipantVideo'; import { selectActiveGroupCall } from '../../../modules/selectors/calls'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/calls/group/GroupCallParticipantVideo.tsx b/src/components/calls/group/GroupCallParticipantVideo.tsx index b2ab55096..d9918cb7f 100644 --- a/src/components/calls/group/GroupCallParticipantVideo.tsx +++ b/src/components/calls/group/GroupCallParticipantVideo.tsx @@ -1,6 +1,6 @@ import { getUserStreams, GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce'; import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../lib/teact/teactn'; +import { withGlobal } from '../../../modules'; import { ApiChat, ApiUser } from '../../../api/types'; diff --git a/src/components/calls/group/GroupCallTopPane.tsx b/src/components/calls/group/GroupCallTopPane.tsx index 31c609deb..1546b091b 100644 --- a/src/components/calls/group/GroupCallTopPane.tsx +++ b/src/components/calls/group/GroupCallTopPane.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiGroupCall, ApiUser } from '../../../api/types'; diff --git a/src/components/calls/group/MicrophoneButton.tsx b/src/components/calls/group/MicrophoneButton.tsx index 475dfd1fd..ea8ec398b 100644 --- a/src/components/calls/group/MicrophoneButton.tsx +++ b/src/components/calls/group/MicrophoneButton.tsx @@ -2,7 +2,7 @@ import { GroupCallConnectionState } from '../../../lib/secret-sauce'; import React, { FC, memo, useEffect, useMemo, useRef, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import buildClassName from '../../../util/buildClassName'; import { vibrateShort } from '../../../util/vibrate'; diff --git a/src/components/common/Audio.tsx b/src/components/common/Audio.tsx index 780be510c..5996bdd39 100644 --- a/src/components/common/Audio.tsx +++ b/src/components/common/Audio.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from '../../lib/teact/teact'; -import { getDispatch } from '../../lib/teact/teactn'; +import { getDispatch } from '../../modules'; import { ApiAudio, ApiMediaFormat, ApiMessage, ApiVoice, diff --git a/src/components/common/ChatExtra.tsx b/src/components/common/ChatExtra.tsx index ceded18f0..72db60ec4 100644 --- a/src/components/common/ChatExtra.tsx +++ b/src/components/common/ChatExtra.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; import { ApiChat, ApiCountryCode, ApiUser } from '../../api/types'; diff --git a/src/components/common/ChatLink.tsx b/src/components/common/ChatLink.tsx index f82bbad27..e4af8a3ea 100644 --- a/src/components/common/ChatLink.tsx +++ b/src/components/common/ChatLink.tsx @@ -1,5 +1,5 @@ import React, { FC, useCallback } from '../../lib/teact/teact'; -import { getDispatch } from '../../lib/teact/teactn'; +import { getDispatch } from '../../modules'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/common/DeleteChatModal.tsx b/src/components/common/DeleteChatModal.tsx index 168c6d943..29d708ce6 100644 --- a/src/components/common/DeleteChatModal.tsx +++ b/src/components/common/DeleteChatModal.tsx @@ -1,5 +1,5 @@ import React, { FC, useCallback, memo } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChat } from '../../api/types'; diff --git a/src/components/common/DeleteMessageModal.tsx b/src/components/common/DeleteMessageModal.tsx index d4f40d6d7..e05b4fbee 100644 --- a/src/components/common/DeleteMessageModal.tsx +++ b/src/components/common/DeleteMessageModal.tsx @@ -1,5 +1,5 @@ import React, { FC, useCallback, memo } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiMessage } from '../../api/types'; import { IAlbum } from '../../types'; diff --git a/src/components/common/Document.tsx b/src/components/common/Document.tsx index 58e44b58d..6ec6d24db 100644 --- a/src/components/common/Document.tsx +++ b/src/components/common/Document.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, memo, useRef, useEffect, useState, } from '../../lib/teact/teact'; -import { getDispatch } from '../../lib/teact/teactn'; +import { getDispatch } from '../../modules'; import { ApiMessage } from '../../api/types'; diff --git a/src/components/common/GroupCallLink.tsx b/src/components/common/GroupCallLink.tsx index cc6bcbc7c..f8304d3d0 100644 --- a/src/components/common/GroupCallLink.tsx +++ b/src/components/common/GroupCallLink.tsx @@ -5,7 +5,7 @@ import { ApiGroupCall } from '../../api/types'; import buildClassName from '../../util/buildClassName'; import Link from '../ui/Link'; -import { getDispatch } from '../../lib/teact/teactn'; +import { getDispatch } from '../../modules'; type OwnProps = { className?: string; diff --git a/src/components/common/GroupChatInfo.tsx b/src/components/common/GroupChatInfo.tsx index f6386abfb..5263b290a 100644 --- a/src/components/common/GroupChatInfo.tsx +++ b/src/components/common/GroupChatInfo.tsx @@ -2,7 +2,7 @@ import { MouseEvent as ReactMouseEvent } from 'react'; import React, { FC, useEffect, useCallback, memo, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChat, ApiTypingStatus } from '../../api/types'; import { GlobalState } from '../../global/types'; diff --git a/src/components/common/MessageLink.tsx b/src/components/common/MessageLink.tsx index d41a6d44c..95d8a3942 100644 --- a/src/components/common/MessageLink.tsx +++ b/src/components/common/MessageLink.tsx @@ -1,5 +1,5 @@ import React, { FC, useCallback } from '../../lib/teact/teact'; -import { getDispatch } from '../../lib/teact/teactn'; +import { getDispatch } from '../../modules'; import { ApiMessage } from '../../api/types'; diff --git a/src/components/common/PickerSelectedItem.tsx b/src/components/common/PickerSelectedItem.tsx index c2f2ee2e4..0833b149d 100644 --- a/src/components/common/PickerSelectedItem.tsx +++ b/src/components/common/PickerSelectedItem.tsx @@ -1,5 +1,5 @@ import React, { FC, memo } from '../../lib/teact/teact'; -import { withGlobal } from '../../lib/teact/teactn'; +import { withGlobal } from '../../modules'; import { ApiChat, ApiUser } from '../../api/types'; diff --git a/src/components/common/PinMessageModal.tsx b/src/components/common/PinMessageModal.tsx index 134bac121..b1a992e42 100644 --- a/src/components/common/PinMessageModal.tsx +++ b/src/components/common/PinMessageModal.tsx @@ -1,5 +1,5 @@ import React, { FC, useCallback, memo } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { selectChat, selectIsChatWithSelf, selectUser } from '../../modules/selectors'; import { diff --git a/src/components/common/PrivateChatInfo.tsx b/src/components/common/PrivateChatInfo.tsx index 0ca19b317..ebb766d08 100644 --- a/src/components/common/PrivateChatInfo.tsx +++ b/src/components/common/PrivateChatInfo.tsx @@ -2,7 +2,7 @@ import { MouseEvent as ReactMouseEvent } from 'react'; import React, { FC, useEffect, useCallback, memo, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiUser, ApiTypingStatus, ApiUserStatus } from '../../api/types'; import { GlobalState } from '../../global/types'; diff --git a/src/components/common/ProfileInfo.tsx b/src/components/common/ProfileInfo.tsx index e902d63b4..1cc91ca45 100644 --- a/src/components/common/ProfileInfo.tsx +++ b/src/components/common/ProfileInfo.tsx @@ -1,7 +1,7 @@ import React, { FC, useEffect, useCallback, memo, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiUser, ApiChat, ApiUserStatus } from '../../api/types'; import { GlobalState } from '../../global/types'; diff --git a/src/components/common/ReactionStaticEmoji.tsx b/src/components/common/ReactionStaticEmoji.tsx index 5079598f0..3012acc7e 100644 --- a/src/components/common/ReactionStaticEmoji.tsx +++ b/src/components/common/ReactionStaticEmoji.tsx @@ -1,6 +1,6 @@ import { RefObject } from 'react'; import React, { FC, memo } from '../../lib/teact/teact'; -import { getGlobal } from '../../lib/teact/teactn'; +import { getGlobal } from '../../modules'; import { ApiMediaFormat } from '../../api/types'; diff --git a/src/components/common/ReportMessageModal.tsx b/src/components/common/ReportMessageModal.tsx index 7627db886..63ef39dd0 100644 --- a/src/components/common/ReportMessageModal.tsx +++ b/src/components/common/ReportMessageModal.tsx @@ -3,7 +3,7 @@ import { ChangeEvent } from 'react'; import React, { FC, memo, useCallback, useState, } from '../../lib/teact/teact'; -import { getDispatch } from '../../lib/teact/teactn'; +import { getDispatch } from '../../modules'; import { ApiReportReason } from '../../api/types'; diff --git a/src/components/common/SafeLink.tsx b/src/components/common/SafeLink.tsx index 065257f9b..db89694a9 100644 --- a/src/components/common/SafeLink.tsx +++ b/src/components/common/SafeLink.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useCallback } from '../../lib/teact/teact'; -import { getDispatch } from '../../lib/teact/teactn'; +import { getDispatch } from '../../modules'; import convertPunycode from '../../lib/punycode'; import { diff --git a/src/components/common/SeenByModal.tsx b/src/components/common/SeenByModal.tsx index 78f104a44..87acf22bb 100644 --- a/src/components/common/SeenByModal.tsx +++ b/src/components/common/SeenByModal.tsx @@ -1,5 +1,5 @@ import React, { FC, useCallback, memo } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import useLang from '../../hooks/useLang'; import { selectChatMessage } from '../../modules/selectors'; diff --git a/src/components/common/StickerSetModal.tsx b/src/components/common/StickerSetModal.tsx index 6b792a7a2..3ced4bbba 100644 --- a/src/components/common/StickerSetModal.tsx +++ b/src/components/common/StickerSetModal.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useRef, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiSticker, ApiStickerSet } from '../../api/types'; diff --git a/src/components/common/TypingStatus.tsx b/src/components/common/TypingStatus.tsx index 86601c337..766db4df8 100644 --- a/src/components/common/TypingStatus.tsx +++ b/src/components/common/TypingStatus.tsx @@ -1,5 +1,5 @@ import React, { FC, memo } from '../../lib/teact/teact'; -import { withGlobal } from '../../lib/teact/teactn'; +import { withGlobal } from '../../modules'; import { ApiUser, ApiTypingStatus } from '../../api/types'; diff --git a/src/components/common/UiLoader.tsx b/src/components/common/UiLoader.tsx index 4d0e07845..56189e6f5 100644 --- a/src/components/common/UiLoader.tsx +++ b/src/components/common/UiLoader.tsx @@ -1,5 +1,5 @@ import React, { FC, useEffect } from '../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../modules'; import { ApiMediaFormat } from '../../api/types'; import { GlobalState } from '../../global/types'; diff --git a/src/components/common/UserLink.tsx b/src/components/common/UserLink.tsx index 2342a3aa5..cfa8618bb 100644 --- a/src/components/common/UserLink.tsx +++ b/src/components/common/UserLink.tsx @@ -5,7 +5,7 @@ import { ApiChat, ApiUser } from '../../api/types'; import buildClassName from '../../util/buildClassName'; import Link from '../ui/Link'; -import { getDispatch } from '../../lib/teact/teactn'; +import { getDispatch } from '../../modules'; type OwnProps = { className?: string; diff --git a/src/components/common/helpers/renderTextWithEntities.tsx b/src/components/common/helpers/renderTextWithEntities.tsx index 534d9db8a..1690f18d4 100644 --- a/src/components/common/helpers/renderTextWithEntities.tsx +++ b/src/components/common/helpers/renderTextWithEntities.tsx @@ -1,6 +1,6 @@ import { MouseEvent } from 'react'; import React from '../../../lib/teact/teact'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; import { ApiFormattedText, ApiMessageEntity, ApiMessageEntityTypes } from '../../../api/types'; import renderText, { TextFilter } from './renderText'; diff --git a/src/components/common/hooks/useAnimatedEmoji.ts b/src/components/common/hooks/useAnimatedEmoji.ts index d8152610b..33a0ddf61 100644 --- a/src/components/common/hooks/useAnimatedEmoji.ts +++ b/src/components/common/hooks/useAnimatedEmoji.ts @@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef, useState, } from '../../../lib/teact/teact'; import safePlay from '../../../util/safePlay'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; import useMedia from '../../../hooks/useMedia'; import { ActiveEmojiInteraction } from '../../../global/types'; import useFlag from '../../../hooks/useFlag'; diff --git a/src/components/left/ChatFolderModal.tsx b/src/components/left/ChatFolderModal.tsx index ff80f58da..c9a3ef280 100644 --- a/src/components/left/ChatFolderModal.tsx +++ b/src/components/left/ChatFolderModal.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, memo, useMemo, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChatFolder } from '../../api/types'; diff --git a/src/components/left/LeftColumn.tsx b/src/components/left/LeftColumn.tsx index 2cfb5eb7e..b917e0a7e 100644 --- a/src/components/left/LeftColumn.tsx +++ b/src/components/left/LeftColumn.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { LeftColumnContent, SettingsScreens } from '../../types'; diff --git a/src/components/left/main/Chat.tsx b/src/components/left/main/Chat.tsx index 5311ca482..e91ebce65 100644 --- a/src/components/left/main/Chat.tsx +++ b/src/components/left/main/Chat.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useLayoutEffect, useMemo, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../../modules'; import useLang, { LangFn } from '../../../hooks/useLang'; diff --git a/src/components/left/main/ChatFolders.tsx b/src/components/left/main/ChatFolders.tsx index 264cd3096..6a2cb2096 100644 --- a/src/components/left/main/ChatFolders.tsx +++ b/src/components/left/main/ChatFolders.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChatFolder } from '../../../api/types'; import { SettingsScreens } from '../../../types'; diff --git a/src/components/left/main/ChatList.tsx b/src/components/left/main/ChatList.tsx index 7acfe7a9c..873f89e9e 100644 --- a/src/components/left/main/ChatList.tsx +++ b/src/components/left/main/ChatList.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useMemo, useEffect, } from '../../../lib/teact/teact'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; import { SettingsScreens } from '../../../types'; import { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer'; diff --git a/src/components/left/main/ContactList.tsx b/src/components/left/main/ContactList.tsx index c84cdaa83..f12c808ad 100644 --- a/src/components/left/main/ContactList.tsx +++ b/src/components/left/main/ContactList.tsx @@ -1,7 +1,7 @@ import React, { FC, useEffect, useCallback, useMemo, memo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiUser, ApiUserStatus } from '../../../api/types'; diff --git a/src/components/left/main/EmptyFolder.tsx b/src/components/left/main/EmptyFolder.tsx index cb7e230ac..19849a916 100644 --- a/src/components/left/main/EmptyFolder.tsx +++ b/src/components/left/main/EmptyFolder.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../lib/teact/teactn'; +import { withGlobal } from '../../../modules'; import { ApiChatFolder, ApiSticker } from '../../../api/types'; import { SettingsScreens } from '../../../types'; diff --git a/src/components/left/main/LeftMainHeader.tsx b/src/components/left/main/LeftMainHeader.tsx index 89e677422..5434b7eba 100644 --- a/src/components/left/main/LeftMainHeader.tsx +++ b/src/components/left/main/LeftMainHeader.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ISettings, LeftColumnContent } from '../../../types'; import { ApiChat } from '../../../api/types'; diff --git a/src/components/left/newChat/NewChatStep1.tsx b/src/components/left/newChat/NewChatStep1.tsx index a827bf7bc..8628ee121 100644 --- a/src/components/left/newChat/NewChatStep1.tsx +++ b/src/components/left/newChat/NewChatStep1.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, useEffect, useMemo, memo, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../../modules'; import { ApiChat } from '../../../api/types'; diff --git a/src/components/left/newChat/NewChatStep2.tsx b/src/components/left/newChat/NewChatStep2.tsx index 2f2c448ce..d50c6a62d 100644 --- a/src/components/left/newChat/NewChatStep2.tsx +++ b/src/components/left/newChat/NewChatStep2.tsx @@ -1,7 +1,7 @@ import React, { FC, useState, useCallback, useEffect, memo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ChatCreationProgress } from '../../../types'; diff --git a/src/components/left/search/AudioResults.tsx b/src/components/left/search/AudioResults.tsx index bc9ec4e59..765c122ed 100644 --- a/src/components/left/search/AudioResults.tsx +++ b/src/components/left/search/AudioResults.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { AudioOrigin, LoadMoreDirection } from '../../../types'; diff --git a/src/components/left/search/ChatMessage.tsx b/src/components/left/search/ChatMessage.tsx index 2121b5cb8..f3134160f 100644 --- a/src/components/left/search/ChatMessage.tsx +++ b/src/components/left/search/ChatMessage.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, diff --git a/src/components/left/search/ChatMessageResults.tsx b/src/components/left/search/ChatMessageResults.tsx index 9f18fa75e..a4252edf6 100644 --- a/src/components/left/search/ChatMessageResults.tsx +++ b/src/components/left/search/ChatMessageResults.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiMessage } from '../../../api/types'; import { LoadMoreDirection } from '../../../types'; diff --git a/src/components/left/search/ChatResults.tsx b/src/components/left/search/ChatResults.tsx index 751f26780..969123e1c 100644 --- a/src/components/left/search/ChatResults.tsx +++ b/src/components/left/search/ChatResults.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../../modules'; import { ApiChat, ApiMessage } from '../../../api/types'; import { LoadMoreDirection } from '../../../types'; diff --git a/src/components/left/search/FileResults.tsx b/src/components/left/search/FileResults.tsx index 6a1fdd019..6835097a1 100644 --- a/src/components/left/search/FileResults.tsx +++ b/src/components/left/search/FileResults.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiMessage } from '../../../api/types'; import { LoadMoreDirection } from '../../../types'; diff --git a/src/components/left/search/LeftSearch.tsx b/src/components/left/search/LeftSearch.tsx index 121ecd5be..2eed43d04 100644 --- a/src/components/left/search/LeftSearch.tsx +++ b/src/components/left/search/LeftSearch.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useState, useMemo, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { GlobalSearchContent } from '../../../types'; diff --git a/src/components/left/search/LeftSearchResultChat.tsx b/src/components/left/search/LeftSearchResultChat.tsx index cb2cec826..c966aaf42 100644 --- a/src/components/left/search/LeftSearchResultChat.tsx +++ b/src/components/left/search/LeftSearchResultChat.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../lib/teact/teactn'; +import { withGlobal } from '../../../modules'; import { ApiChat, ApiUser } from '../../../api/types'; diff --git a/src/components/left/search/LinkResults.tsx b/src/components/left/search/LinkResults.tsx index 633bb3560..a586690d1 100644 --- a/src/components/left/search/LinkResults.tsx +++ b/src/components/left/search/LinkResults.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { LoadMoreDirection } from '../../../types'; diff --git a/src/components/left/search/MediaResults.tsx b/src/components/left/search/MediaResults.tsx index 318c8e0fb..1553ca3ca 100644 --- a/src/components/left/search/MediaResults.tsx +++ b/src/components/left/search/MediaResults.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { LoadMoreDirection, MediaViewerOrigin } from '../../../types'; diff --git a/src/components/left/search/RecentContacts.tsx b/src/components/left/search/RecentContacts.tsx index f939c5577..5b2e12594 100644 --- a/src/components/left/search/RecentContacts.tsx +++ b/src/components/left/search/RecentContacts.tsx @@ -1,7 +1,7 @@ import React, { FC, useEffect, useCallback, useRef, memo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiUser } from '../../../api/types'; diff --git a/src/components/left/settings/BlockUserModal.tsx b/src/components/left/settings/BlockUserModal.tsx index 62117e6cd..a05be8442 100644 --- a/src/components/left/settings/BlockUserModal.tsx +++ b/src/components/left/settings/BlockUserModal.tsx @@ -1,7 +1,7 @@ import React, { FC, useMemo, useState, memo, useRef, useCallback, useEffect, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiUser } from '../../../api/types'; diff --git a/src/components/left/settings/SettingsDataStorage.tsx b/src/components/left/settings/SettingsDataStorage.tsx index a2e1f4765..781131665 100644 --- a/src/components/left/settings/SettingsDataStorage.tsx +++ b/src/components/left/settings/SettingsDataStorage.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { SettingsScreens, ISettings } from '../../../types'; diff --git a/src/components/left/settings/SettingsEditProfile.tsx b/src/components/left/settings/SettingsEditProfile.tsx index 3622906cc..0c43950bd 100644 --- a/src/components/left/settings/SettingsEditProfile.tsx +++ b/src/components/left/settings/SettingsEditProfile.tsx @@ -2,7 +2,7 @@ import { ChangeEvent } from 'react'; import React, { FC, useState, useCallback, memo, useEffect, useMemo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiMediaFormat } from '../../../api/types'; import { ProfileEditProgress, SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsGeneral.tsx b/src/components/left/settings/SettingsGeneral.tsx index 84a5025ed..31d4bee2e 100644 --- a/src/components/left/settings/SettingsGeneral.tsx +++ b/src/components/left/settings/SettingsGeneral.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, memo, useRef, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { SettingsScreens, ISettings, TimeFormat } from '../../../types'; import { ApiSticker, ApiStickerSet } from '../../../api/types'; diff --git a/src/components/left/settings/SettingsGeneralBackground.tsx b/src/components/left/settings/SettingsGeneralBackground.tsx index d0b949b75..894d3979c 100644 --- a/src/components/left/settings/SettingsGeneralBackground.tsx +++ b/src/components/left/settings/SettingsGeneralBackground.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useEffect, useCallback, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { SettingsScreens, ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types'; import { ApiWallpaper } from '../../../api/types'; diff --git a/src/components/left/settings/SettingsGeneralBackgroundColor.tsx b/src/components/left/settings/SettingsGeneralBackgroundColor.tsx index b35dcb977..acb3d29bf 100644 --- a/src/components/left/settings/SettingsGeneralBackgroundColor.tsx +++ b/src/components/left/settings/SettingsGeneralBackgroundColor.tsx @@ -2,7 +2,7 @@ import { ChangeEvent, MutableRefObject, RefObject } from 'react'; import React, { FC, memo, useCallback, useEffect, useRef, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { SettingsScreens, ThemeKey } from '../../../types'; diff --git a/src/components/left/settings/SettingsHeader.tsx b/src/components/left/settings/SettingsHeader.tsx index 374e6dc7c..4817f7850 100644 --- a/src/components/left/settings/SettingsHeader.tsx +++ b/src/components/left/settings/SettingsHeader.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; import { SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsLanguage.tsx b/src/components/left/settings/SettingsLanguage.tsx index c9923c09b..dc321edaa 100644 --- a/src/components/left/settings/SettingsLanguage.tsx +++ b/src/components/left/settings/SettingsLanguage.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ISettings, LangCode, SettingsScreens } from '../../../types'; import { ApiLanguage } from '../../../api/types'; diff --git a/src/components/left/settings/SettingsMain.tsx b/src/components/left/settings/SettingsMain.tsx index 53b1e2ad9..eb73fdc37 100644 --- a/src/components/left/settings/SettingsMain.tsx +++ b/src/components/left/settings/SettingsMain.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useEffect } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { SettingsScreens } from '../../../types'; import { ApiUser } from '../../../api/types'; diff --git a/src/components/left/settings/SettingsNotifications.tsx b/src/components/left/settings/SettingsNotifications.tsx index c54c62f59..0c9d9a40b 100644 --- a/src/components/left/settings/SettingsNotifications.tsx +++ b/src/components/left/settings/SettingsNotifications.tsx @@ -3,7 +3,7 @@ import useDebounce from '../../../hooks/useDebounce'; import React, { FC, memo, useCallback, useEffect, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsPrivacy.tsx b/src/components/left/settings/SettingsPrivacy.tsx index 633b98a81..e339b402a 100644 --- a/src/components/left/settings/SettingsPrivacy.tsx +++ b/src/components/left/settings/SettingsPrivacy.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useEffect } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { PrivacyVisibility, SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsPrivacyActiveSessions.tsx b/src/components/left/settings/SettingsPrivacyActiveSessions.tsx index dfcb6c7a4..8748b043d 100644 --- a/src/components/left/settings/SettingsPrivacyActiveSessions.tsx +++ b/src/components/left/settings/SettingsPrivacyActiveSessions.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiSession } from '../../../api/types'; import { SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx b/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx index 644986a48..b53d1cf6a 100644 --- a/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx +++ b/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiCountryCode, ApiUser } from '../../../api/types'; import { SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsPrivacyVisibility.tsx b/src/components/left/settings/SettingsPrivacyVisibility.tsx index e3f675996..82afcfddd 100644 --- a/src/components/left/settings/SettingsPrivacyVisibility.tsx +++ b/src/components/left/settings/SettingsPrivacyVisibility.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiUser } from '../../../api/types'; import { ApiPrivacySettings, SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx b/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx index d9369e7d1..ec32c5302 100644 --- a/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx +++ b/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../../modules'; import { GlobalState } from '../../../global/types'; import { ApiPrivacySettings, SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsQuickReaction.tsx b/src/components/left/settings/SettingsQuickReaction.tsx index a7e06c1ec..e20229658 100644 --- a/src/components/left/settings/SettingsQuickReaction.tsx +++ b/src/components/left/settings/SettingsQuickReaction.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { SettingsScreens } from '../../../types'; import { ApiAvailableReaction } from '../../../api/types'; diff --git a/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx b/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx index 0bbb10f28..cede391db 100644 --- a/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx +++ b/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useMemo, useCallback, } from '../../../../lib/teact/teact'; -import { getGlobal } from '../../../../lib/teact/teactn'; +import { getGlobal } from '../../../../modules'; import { SettingsScreens } from '../../../../types'; diff --git a/src/components/left/settings/folders/SettingsFoldersEdit.tsx b/src/components/left/settings/folders/SettingsFoldersEdit.tsx index edffc2316..bb1be6fd3 100644 --- a/src/components/left/settings/folders/SettingsFoldersEdit.tsx +++ b/src/components/left/settings/folders/SettingsFoldersEdit.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../../modules'; import { SettingsScreens } from '../../../../types'; diff --git a/src/components/left/settings/folders/SettingsFoldersMain.tsx b/src/components/left/settings/folders/SettingsFoldersMain.tsx index ae0a49118..49604b290 100644 --- a/src/components/left/settings/folders/SettingsFoldersMain.tsx +++ b/src/components/left/settings/folders/SettingsFoldersMain.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useMemo, useCallback, useState, useEffect, } from '../../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../../modules'; import { ApiChatFolder } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFa.tsx b/src/components/left/settings/twoFa/SettingsTwoFa.tsx index f7b7491b8..9066d9b01 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFa.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFa.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, } from '../../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../../modules'; import { GlobalState } from '../../../../global/types'; import { SettingsScreens } from '../../../../types'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx b/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx index c43240dd5..367365c2a 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx @@ -1,5 +1,5 @@ import React, { FC, memo } from '../../../../lib/teact/teact'; -import { withGlobal } from '../../../../lib/teact/teactn'; +import { withGlobal } from '../../../../modules'; import { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx b/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx index 38fdbe5ab..34584edc2 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useEffect, useRef, useState, } from '../../../../lib/teact/teact'; -import { withGlobal } from '../../../../lib/teact/teactn'; +import { withGlobal } from '../../../../modules'; import { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx b/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx index 268348bbe..6b49a80cd 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx @@ -1,5 +1,5 @@ import React, { FC, memo } from '../../../../lib/teact/teact'; -import { withGlobal } from '../../../../lib/teact/teactn'; +import { withGlobal } from '../../../../modules'; import { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx b/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx index 649a39769..281166fb8 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useEffect, useRef, useState, } from '../../../../lib/teact/teact'; -import { withGlobal } from '../../../../lib/teact/teactn'; +import { withGlobal } from '../../../../modules'; import { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx b/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx index f30a4ccd5..0da8c6e7c 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx @@ -1,5 +1,5 @@ import React, { FC, memo } from '../../../../lib/teact/teact'; -import { withGlobal } from '../../../../lib/teact/teactn'; +import { withGlobal } from '../../../../modules'; import { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; diff --git a/src/components/main/Dialogs.tsx b/src/components/main/Dialogs.tsx index d10112286..132d3a6e6 100644 --- a/src/components/main/Dialogs.tsx +++ b/src/components/main/Dialogs.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useEffect } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiContact, ApiError, ApiInviteInfo, ApiPhoto, diff --git a/src/components/main/DownloadManager.tsx b/src/components/main/DownloadManager.tsx index 0af0e3602..90743f7eb 100644 --- a/src/components/main/DownloadManager.tsx +++ b/src/components/main/DownloadManager.tsx @@ -1,5 +1,5 @@ import { FC, memo, useEffect } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { Thread } from '../../global/types'; import { ApiMediaFormat, ApiMessage } from '../../api/types'; diff --git a/src/components/main/ForwardPicker.tsx b/src/components/main/ForwardPicker.tsx index e8beff592..3f243401f 100644 --- a/src/components/main/ForwardPicker.tsx +++ b/src/components/main/ForwardPicker.tsx @@ -1,7 +1,7 @@ import React, { FC, useMemo, useState, memo, useRef, useCallback, useEffect, } from '../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../modules'; import { ApiChat, MAIN_THREAD_ID } from '../../api/types'; diff --git a/src/components/main/HistoryCalendar.tsx b/src/components/main/HistoryCalendar.tsx index 5821ef46e..48676c83c 100644 --- a/src/components/main/HistoryCalendar.tsx +++ b/src/components/main/HistoryCalendar.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useCallback } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import useLang from '../../hooks/useLang'; diff --git a/src/components/main/Main.tsx b/src/components/main/Main.tsx index ea5b61b3c..4cebdfe4d 100644 --- a/src/components/main/Main.tsx +++ b/src/components/main/Main.tsx @@ -1,7 +1,7 @@ import React, { FC, useEffect, memo, useCallback, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { LangCode } from '../../types'; import { ApiMessage, ApiUpdateAuthorizationStateType, ApiUpdateConnectionStateType } from '../../api/types'; diff --git a/src/components/main/Notifications.tsx b/src/components/main/Notifications.tsx index fed02bc10..b7d2650a9 100644 --- a/src/components/main/Notifications.tsx +++ b/src/components/main/Notifications.tsx @@ -1,5 +1,5 @@ import React, { FC, memo } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiNotification } from '../../api/types'; diff --git a/src/components/main/SafeLinkModal.tsx b/src/components/main/SafeLinkModal.tsx index 26d210838..2f11621e7 100644 --- a/src/components/main/SafeLinkModal.tsx +++ b/src/components/main/SafeLinkModal.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useCallback } from '../../lib/teact/teact'; -import { getDispatch } from '../../lib/teact/teactn'; +import { getDispatch } from '../../modules'; import { ensureProtocol } from '../../util/ensureProtocol'; import renderText from '../common/helpers/renderText'; diff --git a/src/components/mediaViewer/MediaViewer.tsx b/src/components/mediaViewer/MediaViewer.tsx index 0300e9b71..f705fd606 100644 --- a/src/components/mediaViewer/MediaViewer.tsx +++ b/src/components/mediaViewer/MediaViewer.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useRef, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser, diff --git a/src/components/mediaViewer/MediaViewerActions.tsx b/src/components/mediaViewer/MediaViewerActions.tsx index 5306ea202..1b4a3ef9f 100644 --- a/src/components/mediaViewer/MediaViewerActions.tsx +++ b/src/components/mediaViewer/MediaViewerActions.tsx @@ -4,7 +4,7 @@ import React, { useCallback, useMemo, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiMessage } from '../../api/types'; diff --git a/src/components/mediaViewer/MediaViewerContent.tsx b/src/components/mediaViewer/MediaViewerContent.tsx index 190ac2a68..dc865f598 100644 --- a/src/components/mediaViewer/MediaViewerContent.tsx +++ b/src/components/mediaViewer/MediaViewerContent.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useCallback } from '../../lib/teact/teact'; -import { withGlobal } from '../../lib/teact/teactn'; +import { withGlobal } from '../../modules'; import { ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser, diff --git a/src/components/mediaViewer/SenderInfo.tsx b/src/components/mediaViewer/SenderInfo.tsx index 0a492b20b..07f12242d 100644 --- a/src/components/mediaViewer/SenderInfo.tsx +++ b/src/components/mediaViewer/SenderInfo.tsx @@ -1,5 +1,5 @@ import React, { FC, useCallback } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChat, ApiMessage, ApiUser } from '../../api/types'; diff --git a/src/components/middle/ActionMessage.tsx b/src/components/middle/ActionMessage.tsx index 958ef9d6b..b5cfb7546 100644 --- a/src/components/middle/ActionMessage.tsx +++ b/src/components/middle/ActionMessage.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useEffect, useMemo, useRef, } from '../../lib/teact/teact'; -import { withGlobal } from '../../lib/teact/teactn'; +import { withGlobal } from '../../modules'; import { ApiUser, ApiMessage, ApiChat } from '../../api/types'; import { FocusDirection } from '../../types'; diff --git a/src/components/middle/AudioPlayer.tsx b/src/components/middle/AudioPlayer.tsx index 683772a66..08333cd01 100644 --- a/src/components/middle/AudioPlayer.tsx +++ b/src/components/middle/AudioPlayer.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, useEffect, useMemo, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { AudioOrigin } from '../../types'; import { diff --git a/src/components/middle/ContactGreeting.tsx b/src/components/middle/ContactGreeting.tsx index 072edd57a..0c311fa67 100644 --- a/src/components/middle/ContactGreeting.tsx +++ b/src/components/middle/ContactGreeting.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useRef, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types'; diff --git a/src/components/middle/DeleteSelectedMessageModal.tsx b/src/components/middle/DeleteSelectedMessageModal.tsx index f6e52c1f2..05b33863f 100644 --- a/src/components/middle/DeleteSelectedMessageModal.tsx +++ b/src/components/middle/DeleteSelectedMessageModal.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, memo, useEffect, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../modules/selectors'; import { diff --git a/src/components/middle/EmojiInteractionAnimation.tsx b/src/components/middle/EmojiInteractionAnimation.tsx index 1832f47fc..be1209dc0 100644 --- a/src/components/middle/EmojiInteractionAnimation.tsx +++ b/src/components/middle/EmojiInteractionAnimation.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ActiveEmojiInteraction } from '../../global/types'; import { ApiMediaFormat } from '../../api/types'; diff --git a/src/components/middle/HeaderActions.tsx b/src/components/middle/HeaderActions.tsx index c676e724b..52a0fc104 100644 --- a/src/components/middle/HeaderActions.tsx +++ b/src/components/middle/HeaderActions.tsx @@ -6,7 +6,7 @@ import React, { useState, useEffect, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { MessageListType } from '../../global/types'; import { MAIN_THREAD_ID } from '../../api/types'; diff --git a/src/components/middle/HeaderMenuContainer.tsx b/src/components/middle/HeaderMenuContainer.tsx index 5fb374950..06818e6a1 100644 --- a/src/components/middle/HeaderMenuContainer.tsx +++ b/src/components/middle/HeaderMenuContainer.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChat } from '../../api/types'; import { IAnchorPosition } from '../../types'; diff --git a/src/components/middle/MessageList.tsx b/src/components/middle/MessageList.tsx index 0c65323e4..4c875d88b 100644 --- a/src/components/middle/MessageList.tsx +++ b/src/components/middle/MessageList.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useRef, useState, } from '../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../modules'; import { ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID, diff --git a/src/components/middle/MessageListContent.tsx b/src/components/middle/MessageListContent.tsx index 25a1dcbf9..879e30582 100644 --- a/src/components/middle/MessageListContent.tsx +++ b/src/components/middle/MessageListContent.tsx @@ -19,7 +19,7 @@ import useMessageObservers from './hooks/useMessageObservers'; import Message from './message/Message'; import SponsoredMessage from './message/SponsoredMessage'; import ActionMessage from './ActionMessage'; -import { getDispatch } from '../../lib/teact/teactn'; +import { getDispatch } from '../../modules'; interface OwnProps { chatId: string; diff --git a/src/components/middle/MessageSelectToolbar.tsx b/src/components/middle/MessageSelectToolbar.tsx index 1420f4b10..19dc64ca8 100644 --- a/src/components/middle/MessageSelectToolbar.tsx +++ b/src/components/middle/MessageSelectToolbar.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { MessageListType } from '../../global/types'; diff --git a/src/components/middle/MiddleColumn.tsx b/src/components/middle/MiddleColumn.tsx index 98b8fb48f..9bc9caa03 100644 --- a/src/components/middle/MiddleColumn.tsx +++ b/src/components/middle/MiddleColumn.tsx @@ -1,7 +1,7 @@ import React, { FC, useEffect, useState, memo, useMemo, useCallback, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types'; import { diff --git a/src/components/middle/MiddleHeader.tsx b/src/components/middle/MiddleHeader.tsx index 56145fe97..e39708121 100644 --- a/src/components/middle/MiddleHeader.tsx +++ b/src/components/middle/MiddleHeader.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import cycleRestrict from '../../util/cycleRestrict'; import { GlobalState, MessageListType } from '../../global/types'; diff --git a/src/components/middle/MobileSearch.tsx b/src/components/middle/MobileSearch.tsx index d0925440b..189bddc7c 100644 --- a/src/components/middle/MobileSearch.tsx +++ b/src/components/middle/MobileSearch.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChat } from '../../api/types'; diff --git a/src/components/middle/ReactorListModal.tsx b/src/components/middle/ReactorListModal.tsx index 660dfeaee..b2052c786 100644 --- a/src/components/middle/ReactorListModal.tsx +++ b/src/components/middle/ReactorListModal.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, memo, useMemo, useEffect, useState, useRef, } from '../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../modules'; import { ApiMessage } from '../../api/types'; import { LoadMoreDirection } from '../../types'; diff --git a/src/components/middle/ScrollDownButton.tsx b/src/components/middle/ScrollDownButton.tsx index 353e4bc90..f5f9b99e1 100644 --- a/src/components/middle/ScrollDownButton.tsx +++ b/src/components/middle/ScrollDownButton.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, memo, useRef, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { MessageListType } from '../../global/types'; import { MAIN_THREAD_ID } from '../../api/types'; diff --git a/src/components/middle/UserReportPanel.tsx b/src/components/middle/UserReportPanel.tsx index ed6bdb889..60569d365 100644 --- a/src/components/middle/UserReportPanel.tsx +++ b/src/components/middle/UserReportPanel.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useState, } from '../../lib/teact/teact'; -import { withGlobal, getDispatch } from '../../lib/teact/teactn'; +import { withGlobal, getDispatch } from '../../modules'; import { ApiUser } from '../../api/types'; diff --git a/src/components/middle/composer/BotCommandMenu.tsx b/src/components/middle/composer/BotCommandMenu.tsx index 1a7c7c119..5eaa248b0 100644 --- a/src/components/middle/composer/BotCommandMenu.tsx +++ b/src/components/middle/composer/BotCommandMenu.tsx @@ -9,7 +9,7 @@ import Menu from '../../ui/Menu'; import BotCommand from './BotCommand'; import './BotCommandMenu.scss'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; export type OwnProps = { isOpen: boolean; diff --git a/src/components/middle/composer/BotCommandTooltip.tsx b/src/components/middle/composer/BotCommandTooltip.tsx index 4821d9d9b..5ded0952f 100644 --- a/src/components/middle/composer/BotCommandTooltip.tsx +++ b/src/components/middle/composer/BotCommandTooltip.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, useEffect, useRef, memo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiBotCommand, ApiUser } from '../../../api/types'; diff --git a/src/components/middle/composer/BotKeyboardMenu.tsx b/src/components/middle/composer/BotKeyboardMenu.tsx index 42a7c724c..90ad00be9 100644 --- a/src/components/middle/composer/BotKeyboardMenu.tsx +++ b/src/components/middle/composer/BotKeyboardMenu.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useEffect } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiMessage } from '../../../api/types'; diff --git a/src/components/middle/composer/Composer.tsx b/src/components/middle/composer/Composer.tsx index 58a4a7e57..8b5854546 100644 --- a/src/components/middle/composer/Composer.tsx +++ b/src/components/middle/composer/Composer.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../../modules'; import { GlobalState, MessageListType } from '../../../global/types'; import { diff --git a/src/components/middle/composer/ComposerEmbeddedMessage.tsx b/src/components/middle/composer/ComposerEmbeddedMessage.tsx index 566cc28a9..b45c5af76 100644 --- a/src/components/middle/composer/ComposerEmbeddedMessage.tsx +++ b/src/components/middle/composer/ComposerEmbeddedMessage.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiMessage, ApiUser } from '../../../api/types'; diff --git a/src/components/middle/composer/EmojiPicker.tsx b/src/components/middle/composer/EmojiPicker.tsx index b2ae80d9e..6d6fbe78e 100644 --- a/src/components/middle/composer/EmojiPicker.tsx +++ b/src/components/middle/composer/EmojiPicker.tsx @@ -1,7 +1,7 @@ import React, { FC, useState, useEffect, memo, useRef, useMemo, useCallback, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../lib/teact/teactn'; +import { withGlobal } from '../../../modules'; import { GlobalState } from '../../../global/types'; diff --git a/src/components/middle/composer/GifPicker.tsx b/src/components/middle/composer/GifPicker.tsx index 3aa19172d..ab6efffc6 100644 --- a/src/components/middle/composer/GifPicker.tsx +++ b/src/components/middle/composer/GifPicker.tsx @@ -1,7 +1,7 @@ import React, { FC, useEffect, memo, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiVideo } from '../../../api/types'; diff --git a/src/components/middle/composer/InlineBotTooltip.tsx b/src/components/middle/composer/InlineBotTooltip.tsx index 0d49621d9..17030e203 100644 --- a/src/components/middle/composer/InlineBotTooltip.tsx +++ b/src/components/middle/composer/InlineBotTooltip.tsx @@ -22,7 +22,7 @@ import ListItem from '../../ui/ListItem'; import InfiniteScroll from '../../ui/InfiniteScroll'; import './InlineBotTooltip.scss'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; const INTERSECTION_DEBOUNCE_MS = 200; const runThrottled = throttle((cb) => cb(), 500, true); diff --git a/src/components/middle/composer/MentionTooltip.tsx b/src/components/middle/composer/MentionTooltip.tsx index 856e8d831..f2d9fc272 100644 --- a/src/components/middle/composer/MentionTooltip.tsx +++ b/src/components/middle/composer/MentionTooltip.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, useEffect, useRef, memo, } from '../../../lib/teact/teact'; -import { getGlobal } from '../../../lib/teact/teactn'; +import { getGlobal } from '../../../modules'; import { ApiUser } from '../../../api/types'; diff --git a/src/components/middle/composer/MessageInput.tsx b/src/components/middle/composer/MessageInput.tsx index bb2b28192..779d135e5 100644 --- a/src/components/middle/composer/MessageInput.tsx +++ b/src/components/middle/composer/MessageInput.tsx @@ -2,7 +2,7 @@ import { ChangeEvent } from 'react'; import React, { FC, useEffect, useRef, memo, useState, useCallback, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { IAnchorPosition, ISettings } from '../../../types'; diff --git a/src/components/middle/composer/SendAsMenu.tsx b/src/components/middle/composer/SendAsMenu.tsx index 121dd5473..f424e6e76 100644 --- a/src/components/middle/composer/SendAsMenu.tsx +++ b/src/components/middle/composer/SendAsMenu.tsx @@ -10,7 +10,7 @@ import { getUserFullName, isUserId } from '../../../modules/helpers'; import useMouseInside from '../../../hooks/useMouseInside'; import useLang from '../../../hooks/useLang'; import buildClassName from '../../../util/buildClassName'; -import { getDispatch, getGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal } from '../../../modules'; import ListItem from '../../ui/ListItem'; import Avatar from '../../common/Avatar'; diff --git a/src/components/middle/composer/StickerPicker.tsx b/src/components/middle/composer/StickerPicker.tsx index 20d9e6d8c..c3294ce67 100644 --- a/src/components/middle/composer/StickerPicker.tsx +++ b/src/components/middle/composer/StickerPicker.tsx @@ -1,7 +1,7 @@ import React, { FC, useState, useEffect, memo, useRef, useMemo, useCallback, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiStickerSet, ApiSticker } from '../../../api/types'; import { StickerSetOrRecent } from '../../../types'; diff --git a/src/components/middle/composer/StickerTooltip.tsx b/src/components/middle/composer/StickerTooltip.tsx index 7dfeae409..ab276a35f 100644 --- a/src/components/middle/composer/StickerTooltip.tsx +++ b/src/components/middle/composer/StickerTooltip.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useEffect, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiSticker } from '../../../api/types'; diff --git a/src/components/middle/composer/SymbolMenu.tsx b/src/components/middle/composer/SymbolMenu.tsx index 3b0f48090..c6e221fe2 100644 --- a/src/components/middle/composer/SymbolMenu.tsx +++ b/src/components/middle/composer/SymbolMenu.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../lib/teact/teactn'; +import { withGlobal } from '../../../modules'; import { ApiSticker, ApiVideo } from '../../../api/types'; diff --git a/src/components/middle/composer/WebPagePreview.tsx b/src/components/middle/composer/WebPagePreview.tsx index bfd66bd8c..3203bc746 100644 --- a/src/components/middle/composer/WebPagePreview.tsx +++ b/src/components/middle/composer/WebPagePreview.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useEffect } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiMessage, ApiMessageEntityTypes, ApiWebPage } from '../../../api/types'; import { ISettings } from '../../../types'; diff --git a/src/components/middle/composer/hooks/useDraft.ts b/src/components/middle/composer/hooks/useDraft.ts index b62712032..76a046329 100644 --- a/src/components/middle/composer/hooks/useDraft.ts +++ b/src/components/middle/composer/hooks/useDraft.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useMemo } from '../../../../lib/teact/teact'; -import { getDispatch } from '../../../../lib/teact/teactn'; +import { getDispatch } from '../../../../modules'; import { ApiFormattedText, ApiMessage } from '../../../../api/types'; diff --git a/src/components/middle/composer/hooks/useEditing.ts b/src/components/middle/composer/hooks/useEditing.ts index 10caebcf9..29476bf0b 100644 --- a/src/components/middle/composer/hooks/useEditing.ts +++ b/src/components/middle/composer/hooks/useEditing.ts @@ -1,5 +1,5 @@ import { useCallback } from '../../../../lib/teact/teact'; -import { getDispatch } from '../../../../lib/teact/teactn'; +import { getDispatch } from '../../../../modules'; import { ApiMessage } from '../../../../api/types'; diff --git a/src/components/middle/composer/hooks/useInlineBotTooltip.ts b/src/components/middle/composer/hooks/useInlineBotTooltip.ts index 15298e17b..e7f02bba0 100644 --- a/src/components/middle/composer/hooks/useInlineBotTooltip.ts +++ b/src/components/middle/composer/hooks/useInlineBotTooltip.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect } from '../../../../lib/teact/teact'; -import { getDispatch } from '../../../../lib/teact/teactn'; +import { getDispatch } from '../../../../modules'; import { InlineBotSettings } from '../../../../types'; import useFlag from '../../../../hooks/useFlag'; import usePrevious from '../../../../hooks/usePrevious'; diff --git a/src/components/middle/composer/hooks/useMentionTooltip.ts b/src/components/middle/composer/hooks/useMentionTooltip.ts index ff7a45e34..0b6a29eb7 100644 --- a/src/components/middle/composer/hooks/useMentionTooltip.ts +++ b/src/components/middle/composer/hooks/useMentionTooltip.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useState, } from '../../../../lib/teact/teact'; -import { getGlobal } from '../../../../lib/teact/teactn'; +import { getGlobal } from '../../../../modules'; import { ApiMessageEntityTypes, ApiChatMember, ApiUser } from '../../../../api/types'; import { EDITABLE_INPUT_ID } from '../../../../config'; diff --git a/src/components/middle/composer/hooks/useStickerTooltip.ts b/src/components/middle/composer/hooks/useStickerTooltip.ts index 695045701..e82c807b9 100644 --- a/src/components/middle/composer/hooks/useStickerTooltip.ts +++ b/src/components/middle/composer/hooks/useStickerTooltip.ts @@ -1,5 +1,5 @@ import { useEffect, useMemo } from '../../../../lib/teact/teact'; -import { getDispatch } from '../../../../lib/teact/teactn'; +import { getDispatch } from '../../../../modules'; import { ApiSticker } from '../../../../api/types'; diff --git a/src/components/middle/hooks/useMessageObservers.ts b/src/components/middle/hooks/useMessageObservers.ts index c20f1601f..91afc56da 100644 --- a/src/components/middle/hooks/useMessageObservers.ts +++ b/src/components/middle/hooks/useMessageObservers.ts @@ -1,5 +1,5 @@ import { RefObject } from 'react'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; import { MessageListType } from '../../../global/types'; diff --git a/src/components/middle/hooks/useScrollHooks.ts b/src/components/middle/hooks/useScrollHooks.ts index 07a4cd1b7..f90b47e6b 100644 --- a/src/components/middle/hooks/useScrollHooks.ts +++ b/src/components/middle/hooks/useScrollHooks.ts @@ -1,5 +1,5 @@ import { RefObject } from 'react'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; import { useMemo, useRef } from '../../../lib/teact/teact'; import { LoadMoreDirection } from '../../../types'; diff --git a/src/components/middle/message/Album.tsx b/src/components/middle/message/Album.tsx index b32ea0f05..bc22ae9b1 100644 --- a/src/components/middle/message/Album.tsx +++ b/src/components/middle/message/Album.tsx @@ -6,7 +6,7 @@ import { IAlbum, ISettings } from '../../../types'; import { AlbumRectPart, IAlbumLayout } from './helpers/calculateAlbumLayout'; import { getMessageContent, getMessageHtmlId } from '../../../modules/helpers'; -import { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../../modules'; import withSelectControl from './hocs/withSelectControl'; import { ObserveFn } from '../../../hooks/useIntersectionObserver'; import { diff --git a/src/components/middle/message/CommentButton.tsx b/src/components/middle/message/CommentButton.tsx index 3ff995073..f6daf42c3 100644 --- a/src/components/middle/message/CommentButton.tsx +++ b/src/components/middle/message/CommentButton.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal } from '../../../modules'; import { ApiChat, ApiThreadInfo, ApiUser, diff --git a/src/components/middle/message/Contact.tsx b/src/components/middle/message/Contact.tsx index 496603343..012543786 100644 --- a/src/components/middle/message/Contact.tsx +++ b/src/components/middle/message/Contact.tsx @@ -1,5 +1,5 @@ import React, { FC, useCallback } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiUser, ApiContact, ApiCountryCode } from '../../../api/types'; diff --git a/src/components/middle/message/ContextMenuContainer.tsx b/src/components/middle/message/ContextMenuContainer.tsx index efcc9d8af..3de360fc9 100644 --- a/src/components/middle/message/ContextMenuContainer.tsx +++ b/src/components/middle/message/ContextMenuContainer.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../../modules'; import { MessageListType } from '../../../global/types'; import { ApiAvailableReaction, ApiMessage } from '../../../api/types'; diff --git a/src/components/middle/message/MentionLink.tsx b/src/components/middle/message/MentionLink.tsx index 8be7f4044..c3c501cf5 100644 --- a/src/components/middle/message/MentionLink.tsx +++ b/src/components/middle/message/MentionLink.tsx @@ -1,5 +1,5 @@ import React, { FC } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiUser } from '../../../api/types'; diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx index 833824110..2d1c237e2 100644 --- a/src/components/middle/message/Message.tsx +++ b/src/components/middle/message/Message.tsx @@ -6,7 +6,7 @@ import React, { useMemo, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ActiveEmojiInteraction, ActiveReaction, MessageListType } from '../../../global/types'; import { diff --git a/src/components/middle/message/Poll.tsx b/src/components/middle/message/Poll.tsx index 11742b994..ce0c19f30 100644 --- a/src/components/middle/message/Poll.tsx +++ b/src/components/middle/message/Poll.tsx @@ -7,7 +7,7 @@ import React, { useMemo, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiMessage, ApiPoll, ApiUser, ApiPollAnswer, diff --git a/src/components/middle/message/ReactionAnimatedEmoji.tsx b/src/components/middle/message/ReactionAnimatedEmoji.tsx index a4a5c5c73..81035351d 100644 --- a/src/components/middle/message/ReactionAnimatedEmoji.tsx +++ b/src/components/middle/message/ReactionAnimatedEmoji.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; import { ActiveReaction } from '../../../global/types'; import { ApiAvailableReaction, ApiMediaFormat } from '../../../api/types'; diff --git a/src/components/middle/message/ReactionButton.tsx b/src/components/middle/message/ReactionButton.tsx index 1fd369c82..59bded625 100644 --- a/src/components/middle/message/ReactionButton.tsx +++ b/src/components/middle/message/ReactionButton.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal } from '../../../modules'; import { ApiAvailableReaction, ApiMessage, ApiReactionCount, ApiUser, diff --git a/src/components/middle/message/RoundVideo.tsx b/src/components/middle/message/RoundVideo.tsx index 1dcde9c2b..54b9a4613 100644 --- a/src/components/middle/message/RoundVideo.tsx +++ b/src/components/middle/message/RoundVideo.tsx @@ -5,7 +5,7 @@ import React, { useRef, useState, } from '../../../lib/teact/teact'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; import { ApiMediaFormat, ApiMessage } from '../../../api/types'; diff --git a/src/components/middle/message/SponsoredMessage.tsx b/src/components/middle/message/SponsoredMessage.tsx index 66bf7f99d..bc03214de 100644 --- a/src/components/middle/message/SponsoredMessage.tsx +++ b/src/components/middle/message/SponsoredMessage.tsx @@ -2,7 +2,7 @@ import { RefObject } from 'react'; import React, { FC, memo, useEffect, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiSponsoredMessage, ApiUser } from '../../../api/types'; diff --git a/src/components/middle/message/Video.tsx b/src/components/middle/message/Video.tsx index a2e70a4a3..c43183863 100644 --- a/src/components/middle/message/Video.tsx +++ b/src/components/middle/message/Video.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, useRef, useState, } from '../../../lib/teact/teact'; -import { getDispatch } from '../../../lib/teact/teactn'; +import { getDispatch } from '../../../modules'; import { ApiMediaFormat, ApiMessage } from '../../../api/types'; import { IMediaDimensions } from './helpers/calculateAlbumLayout'; diff --git a/src/components/middle/message/hocs/withSelectControl.tsx b/src/components/middle/message/hocs/withSelectControl.tsx index 3aeef90a3..5b631ec2d 100644 --- a/src/components/middle/message/hocs/withSelectControl.tsx +++ b/src/components/middle/message/hocs/withSelectControl.tsx @@ -5,7 +5,7 @@ import React, { useMemo, memo, } from '../../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../../modules'; import { OwnProps as PhotoProps } from '../Photo'; import { OwnProps as VideoProps } from '../Video'; diff --git a/src/components/middle/message/hooks/useInnerHandlers.ts b/src/components/middle/message/hooks/useInnerHandlers.ts index dda67a790..f1ee730c1 100644 --- a/src/components/middle/message/hooks/useInnerHandlers.ts +++ b/src/components/middle/message/hooks/useInnerHandlers.ts @@ -1,5 +1,5 @@ import React, { useCallback } from '../../../../lib/teact/teact'; -import { getDispatch } from '../../../../lib/teact/teactn'; +import { getDispatch } from '../../../../modules'; import { IAlbum, MediaViewerOrigin } from '../../../../types'; import { diff --git a/src/components/middle/message/hooks/useOuterHandlers.ts b/src/components/middle/message/hooks/useOuterHandlers.ts index 2a88675ac..a50213234 100644 --- a/src/components/middle/message/hooks/useOuterHandlers.ts +++ b/src/components/middle/message/hooks/useOuterHandlers.ts @@ -1,6 +1,6 @@ import { RefObject } from 'react'; import React, { useEffect, useRef } from '../../../../lib/teact/teact'; -import { getDispatch } from '../../../../lib/teact/teactn'; +import { getDispatch } from '../../../../modules'; import { IS_ANDROID, IS_TOUCH_ENV } from '../../../../util/environment'; import windowSize from '../../../../util/windowSize'; diff --git a/src/components/payment/PaymentModal.tsx b/src/components/payment/PaymentModal.tsx index e3bde4055..41b495e8b 100644 --- a/src/components/payment/PaymentModal.tsx +++ b/src/components/payment/PaymentModal.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; import { PaymentStep, ShippingOption, Price } from '../../types'; diff --git a/src/components/payment/ReceiptModal.tsx b/src/components/payment/ReceiptModal.tsx index a90ea20be..2a986e206 100644 --- a/src/components/payment/ReceiptModal.tsx +++ b/src/components/payment/ReceiptModal.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useMemo, } from '../../lib/teact/teact'; -import { withGlobal } from '../../lib/teact/teactn'; +import { withGlobal } from '../../modules'; import { Price } from '../../types'; import { ApiShippingAddress } from '../../api/types'; diff --git a/src/components/right/AddChatMembers.tsx b/src/components/right/AddChatMembers.tsx index fa78c5785..1b3574f1e 100644 --- a/src/components/right/AddChatMembers.tsx +++ b/src/components/right/AddChatMembers.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, useMemo, memo, useState, useEffect, } from '../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../modules'; import { ApiChat, ApiChatMember, ApiUpdateConnectionStateType, diff --git a/src/components/right/DeleteMemberModal.tsx b/src/components/right/DeleteMemberModal.tsx index feab7e857..8815c03c3 100644 --- a/src/components/right/DeleteMemberModal.tsx +++ b/src/components/right/DeleteMemberModal.tsx @@ -1,5 +1,5 @@ import React, { FC, useCallback, memo } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChat } from '../../api/types'; diff --git a/src/components/right/GifSearch.tsx b/src/components/right/GifSearch.tsx index 72e7135ac..b14e8e6c5 100644 --- a/src/components/right/GifSearch.tsx +++ b/src/components/right/GifSearch.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useRef, useCallback, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChat, ApiVideo } from '../../api/types'; diff --git a/src/components/right/PollAnswerResults.tsx b/src/components/right/PollAnswerResults.tsx index bb8adea51..5760a6b47 100644 --- a/src/components/right/PollAnswerResults.tsx +++ b/src/components/right/PollAnswerResults.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, useState, memo, useEffect, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiChat, diff --git a/src/components/right/PollResults.tsx b/src/components/right/PollResults.tsx index f7315492c..4df7a3ac2 100644 --- a/src/components/right/PollResults.tsx +++ b/src/components/right/PollResults.tsx @@ -1,5 +1,5 @@ import React, { FC, memo } from '../../lib/teact/teact'; -import { withGlobal } from '../../lib/teact/teactn'; +import { withGlobal } from '../../modules'; import { ApiMessage, ApiChat } from '../../api/types'; import { selectChat, selectChatMessage } from '../../modules/selectors'; diff --git a/src/components/right/Profile.tsx b/src/components/right/Profile.tsx index e22fb8f03..7ffd13ce9 100644 --- a/src/components/right/Profile.tsx +++ b/src/components/right/Profile.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, useEffect, useMemo, useRef, useState, memo, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { MAIN_THREAD_ID, diff --git a/src/components/right/RightColumn.tsx b/src/components/right/RightColumn.tsx index 37f6ab538..5feedcc99 100644 --- a/src/components/right/RightColumn.tsx +++ b/src/components/right/RightColumn.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ManagementScreens, NewChatMembersProgress, ProfileState, RightColumnContent, diff --git a/src/components/right/RightHeader.tsx b/src/components/right/RightHeader.tsx index 06ddcb2f1..9c2e41430 100644 --- a/src/components/right/RightHeader.tsx +++ b/src/components/right/RightHeader.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ManagementScreens, ProfileState } from '../../types'; import { ApiExportedInvite } from '../../api/types'; diff --git a/src/components/right/RightSearch.tsx b/src/components/right/RightSearch.tsx index 08938455d..ac8bee0f9 100644 --- a/src/components/right/RightSearch.tsx +++ b/src/components/right/RightSearch.tsx @@ -1,7 +1,7 @@ import React, { FC, useMemo, memo, useRef, } from '../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../modules'; import { ApiMessage, ApiUser, ApiChat } from '../../api/types'; diff --git a/src/components/right/StickerSearch.tsx b/src/components/right/StickerSearch.tsx index 311514d67..6c2e9f1a8 100644 --- a/src/components/right/StickerSearch.tsx +++ b/src/components/right/StickerSearch.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useEffect, useRef, useState, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { throttle } from '../../util/schedulers'; import { selectCurrentStickerSearch } from '../../modules/selectors'; diff --git a/src/components/right/StickerSetResult.tsx b/src/components/right/StickerSetResult.tsx index 417eeb31b..3f0ea0e5e 100644 --- a/src/components/right/StickerSetResult.tsx +++ b/src/components/right/StickerSetResult.tsx @@ -1,7 +1,7 @@ import React, { FC, useEffect, memo, useMemo, useCallback, } from '../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../modules'; import { ApiStickerSet } from '../../api/types'; import { ObserveFn } from '../../hooks/useIntersectionObserver'; diff --git a/src/components/right/management/JoinRequest.tsx b/src/components/right/management/JoinRequest.tsx index a5954333d..6b67bb6c6 100644 --- a/src/components/right/management/JoinRequest.tsx +++ b/src/components/right/management/JoinRequest.tsx @@ -1,5 +1,5 @@ import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiUser } from '../../../api/types'; diff --git a/src/components/right/management/ManageChannel.tsx b/src/components/right/management/ManageChannel.tsx index ad09f242d..a3d777352 100644 --- a/src/components/right/management/ManageChannel.tsx +++ b/src/components/right/management/ManageChannel.tsx @@ -2,7 +2,7 @@ import { ChangeEvent } from 'react'; import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ManagementScreens, ManagementProgress } from '../../../types'; import { ApiChat, ApiExportedInvite, ApiMediaFormat } from '../../../api/types'; diff --git a/src/components/right/management/ManageChatAdministrators.tsx b/src/components/right/management/ManageChatAdministrators.tsx index 46d0c9f7e..b05b568ff 100644 --- a/src/components/right/management/ManageChatAdministrators.tsx +++ b/src/components/right/management/ManageChatAdministrators.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getGlobal, withGlobal } from '../../../modules'; import { ManagementScreens } from '../../../types'; import { ApiChat, ApiChatMember } from '../../../api/types'; diff --git a/src/components/right/management/ManageChatPrivacyType.tsx b/src/components/right/management/ManageChatPrivacyType.tsx index 0a649c886..9cda789c5 100644 --- a/src/components/right/management/ManageChatPrivacyType.tsx +++ b/src/components/right/management/ManageChatPrivacyType.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat } from '../../../api/types'; import { ManagementProgress } from '../../../types'; diff --git a/src/components/right/management/ManageChatRemovedUsers.tsx b/src/components/right/management/ManageChatRemovedUsers.tsx index 26324bd65..d9fade276 100644 --- a/src/components/right/management/ManageChatRemovedUsers.tsx +++ b/src/components/right/management/ManageChatRemovedUsers.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiChatMember, ApiUser } from '../../../api/types'; diff --git a/src/components/right/management/ManageDiscussion.tsx b/src/components/right/management/ManageDiscussion.tsx index 151fc3cae..fa9c6d1a7 100644 --- a/src/components/right/management/ManageDiscussion.tsx +++ b/src/components/right/management/ManageDiscussion.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat } from '../../../api/types'; import { ManagementScreens } from '../../../types'; diff --git a/src/components/right/management/ManageGroup.tsx b/src/components/right/management/ManageGroup.tsx index 335f1b2fe..613300c60 100644 --- a/src/components/right/management/ManageGroup.tsx +++ b/src/components/right/management/ManageGroup.tsx @@ -2,7 +2,7 @@ import { ChangeEvent } from 'react'; import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ManagementScreens, ManagementProgress } from '../../../types'; import { diff --git a/src/components/right/management/ManageGroupAdminRights.tsx b/src/components/right/management/ManageGroupAdminRights.tsx index cc83b7eff..6c47e1df3 100644 --- a/src/components/right/management/ManageGroupAdminRights.tsx +++ b/src/components/right/management/ManageGroupAdminRights.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../../modules'; import { ApiChat, ApiChatAdminRights, ApiUser } from '../../../api/types'; import { ManagementScreens } from '../../../types'; diff --git a/src/components/right/management/ManageGroupMembers.tsx b/src/components/right/management/ManageGroupMembers.tsx index 682d701c9..5db37a48a 100644 --- a/src/components/right/management/ManageGroupMembers.tsx +++ b/src/components/right/management/ManageGroupMembers.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../../modules'; import { ApiChatMember, ApiUserStatus } from '../../../api/types'; import { ManagementScreens } from '../../../types'; diff --git a/src/components/right/management/ManageGroupPermissions.tsx b/src/components/right/management/ManageGroupPermissions.tsx index 2d4644d63..03c93a80d 100644 --- a/src/components/right/management/ManageGroupPermissions.tsx +++ b/src/components/right/management/ManageGroupPermissions.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ManagementScreens } from '../../../types'; import { ApiChat, ApiChatBannedRights, ApiChatMember } from '../../../api/types'; diff --git a/src/components/right/management/ManageGroupRecentActions.tsx b/src/components/right/management/ManageGroupRecentActions.tsx index bb5f60d2a..c01bb5fc2 100644 --- a/src/components/right/management/ManageGroupRecentActions.tsx +++ b/src/components/right/management/ManageGroupRecentActions.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../lib/teact/teactn'; +import { withGlobal } from '../../../modules'; import { ApiChat, ApiChatMember } from '../../../api/types'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/right/management/ManageGroupUserPermissions.tsx b/src/components/right/management/ManageGroupUserPermissions.tsx index 05d3ff278..8ad5ba912 100644 --- a/src/components/right/management/ManageGroupUserPermissions.tsx +++ b/src/components/right/management/ManageGroupUserPermissions.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiChatBannedRights } from '../../../api/types'; import { ManagementScreens } from '../../../types'; diff --git a/src/components/right/management/ManageGroupUserPermissionsCreate.tsx b/src/components/right/management/ManageGroupUserPermissionsCreate.tsx index 58e11c45b..d2fbe9ac3 100644 --- a/src/components/right/management/ManageGroupUserPermissionsCreate.tsx +++ b/src/components/right/management/ManageGroupUserPermissionsCreate.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../lib/teact/teactn'; +import { withGlobal } from '../../../modules'; import { ApiChatMember, ApiUser, ApiUserStatus } from '../../../api/types'; import { ManagementScreens } from '../../../types'; diff --git a/src/components/right/management/ManageInvite.tsx b/src/components/right/management/ManageInvite.tsx index 09beb9383..0988c1b30 100644 --- a/src/components/right/management/ManageInvite.tsx +++ b/src/components/right/management/ManageInvite.tsx @@ -2,7 +2,7 @@ import { ChangeEvent } from 'react'; import React, { FC, memo, useCallback, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiExportedInvite } from '../../../api/types'; import { ManagementScreens } from '../../../types'; diff --git a/src/components/right/management/ManageInviteInfo.tsx b/src/components/right/management/ManageInviteInfo.tsx index 21311198b..6d32fce6b 100644 --- a/src/components/right/management/ManageInviteInfo.tsx +++ b/src/components/right/management/ManageInviteInfo.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChatInviteImporter, ApiExportedInvite, ApiUser } from '../../../api/types'; diff --git a/src/components/right/management/ManageInvites.tsx b/src/components/right/management/ManageInvites.tsx index f90ae04e6..f72dd81a5 100644 --- a/src/components/right/management/ManageInvites.tsx +++ b/src/components/right/management/ManageInvites.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat, ApiExportedInvite } from '../../../api/types'; import { ManagementScreens } from '../../../types'; diff --git a/src/components/right/management/ManageJoinRequests.tsx b/src/components/right/management/ManageJoinRequests.tsx index 1e4c3b33f..de6111319 100644 --- a/src/components/right/management/ManageJoinRequests.tsx +++ b/src/components/right/management/ManageJoinRequests.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiChat } from '../../../api/types'; diff --git a/src/components/right/management/ManageReactions.tsx b/src/components/right/management/ManageReactions.tsx index 9ec4953fe..7fef4793b 100644 --- a/src/components/right/management/ManageReactions.tsx +++ b/src/components/right/management/ManageReactions.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiAvailableReaction, ApiChat } from '../../../api/types'; diff --git a/src/components/right/management/ManageUser.tsx b/src/components/right/management/ManageUser.tsx index b920ac4c2..feb237761 100644 --- a/src/components/right/management/ManageUser.tsx +++ b/src/components/right/management/ManageUser.tsx @@ -2,7 +2,7 @@ import { ChangeEvent } from 'react'; import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { ApiUser } from '../../../api/types'; import { ManagementProgress } from '../../../types'; diff --git a/src/components/right/management/Management.tsx b/src/components/right/management/Management.tsx index 9e05eb2f8..7fd5d3ba2 100644 --- a/src/components/right/management/Management.tsx +++ b/src/components/right/management/Management.tsx @@ -1,5 +1,5 @@ import React, { FC, memo } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../lib/teact/teactn'; +import { withGlobal } from '../../../modules'; import { ManagementScreens, ManagementType } from '../../../types'; diff --git a/src/components/right/management/RemoveGroupUserModal.tsx b/src/components/right/management/RemoveGroupUserModal.tsx index 6d2896838..392b6f679 100644 --- a/src/components/right/management/RemoveGroupUserModal.tsx +++ b/src/components/right/management/RemoveGroupUserModal.tsx @@ -1,7 +1,7 @@ import React, { FC, useMemo, useState, memo, useRef, useCallback, } from '../../../lib/teact/teact'; -import { getDispatch, getGlobal, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, getGlobal, withGlobal } from '../../../modules'; import { ApiChat } from '../../../api/types'; diff --git a/src/components/right/statistics/Statistics.tsx b/src/components/right/statistics/Statistics.tsx index d35640f5a..2cc1c4801 100644 --- a/src/components/right/statistics/Statistics.tsx +++ b/src/components/right/statistics/Statistics.tsx @@ -1,7 +1,7 @@ import React, { FC, memo, useState, useEffect, useRef, } from '../../../lib/teact/teact'; -import { getDispatch, withGlobal } from '../../../lib/teact/teactn'; +import { getDispatch, withGlobal } from '../../../modules'; import { callApi } from '../../../api/gramjs'; import { diff --git a/src/components/test/ErrorTest.tsx b/src/components/test/ErrorTest.tsx index bbd7c3ad3..d97f0441a 100644 --- a/src/components/test/ErrorTest.tsx +++ b/src/components/test/ErrorTest.tsx @@ -1,5 +1,5 @@ -import { FC } from '../../lib/teact/teact'; -import React, { withGlobal } from '../../lib/teact/teactn'; +import React, { FC } from '../../lib/teact/teact'; +import { withGlobal } from '../../modules'; type OwnProps = { parentRand: number; diff --git a/src/components/test/SubTest.tsx b/src/components/test/SubTest.tsx index 857353da3..2e24d2f8c 100644 --- a/src/components/test/SubTest.tsx +++ b/src/components/test/SubTest.tsx @@ -1,5 +1,4 @@ -import { FC, useState } from '../../lib/teact/teact'; -import React from '../../lib/teact/teactn'; +import React, { FC, useState } from '../../lib/teact/teact'; import { ApiUpdateAuthorizationStateType } from '../../api/types'; type OwnProps = { diff --git a/src/components/test/Test.tsx b/src/components/test/Test.tsx index 8ef1ecfd5..ed0dc47b9 100644 --- a/src/components/test/Test.tsx +++ b/src/components/test/Test.tsx @@ -1,5 +1,5 @@ import React, { FC, useState } from '../../lib/teact/teact'; -import { withGlobal } from '../../lib/teact/teactn'; +import { withGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; import SubTest from './SubTest'; diff --git a/src/components/test/TestNoRedundancy.tsx b/src/components/test/TestNoRedundancy.tsx index 5474381a4..be2628aef 100644 --- a/src/components/test/TestNoRedundancy.tsx +++ b/src/components/test/TestNoRedundancy.tsx @@ -1,5 +1,5 @@ import React, { FC } from '../../lib/teact/teact'; -import { getGlobal, setGlobal, withGlobal } from '../../lib/teact/teactn'; +import { getGlobal, setGlobal, withGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; document.ondblclick = () => { diff --git a/src/components/ui/Transition.tsx b/src/components/ui/Transition.tsx index ba3ec2055..94072737f 100644 --- a/src/components/ui/Transition.tsx +++ b/src/components/ui/Transition.tsx @@ -2,7 +2,7 @@ import { RefObject } from 'react'; import React, { FC, useLayoutEffect, useRef, } from '../../lib/teact/teact'; -import { getGlobal } from '../../lib/teact/teactn'; +import { getGlobal } from '../../modules'; import { GlobalState } from '../../global/types'; import { ANIMATION_LEVEL_MIN } from '../../config'; diff --git a/src/global/cache.ts b/src/global/cache.ts index bd755b61b..5e7998578 100644 --- a/src/global/cache.ts +++ b/src/global/cache.ts @@ -1,6 +1,6 @@ -import { - addCallback, addReducer, getGlobal, removeCallback, -} from '../lib/teact/teactn'; +import { addCallback, removeCallback } from '../lib/teact/teactn'; + +import { addReducer, getGlobal } from '../modules'; import { GlobalState } from './types'; import { MAIN_THREAD_ID } from '../api/types'; diff --git a/src/global/index.ts b/src/global/index.ts index abdceccc1..f96f16ce6 100644 --- a/src/global/index.ts +++ b/src/global/index.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../lib/teact/teactn'; +import { addReducer } from '../modules'; import { INITIAL_STATE } from './initial'; import { initCache, loadCache } from './cache'; diff --git a/src/global/types.ts b/src/global/types.ts index 614053aab..4c534affe 100644 --- a/src/global/types.ts +++ b/src/global/types.ts @@ -27,7 +27,7 @@ import { ApiAppConfig, ApiSponsoredMessage, ApiStatistics, - ApiPaymentFormNativeParams, + ApiPaymentFormNativeParams, ApiUpdate, } from '../api/types'; import { FocusDirection, @@ -54,6 +54,7 @@ import { AudioOrigin, ManagementState, } from '../types'; +import { typify } from '../lib/teact/teactn'; export type MessageListType = 'thread' @@ -506,9 +507,13 @@ export type GlobalState = { }; }; -export type ActionTypes = ( +export interface ActionPayloads { + apiUpdate: ApiUpdate; +} + +export type NonTypedActionNames = ( // system - 'init' | 'reset' | 'disconnect' | 'initApi' | 'apiUpdate' | 'sync' | 'saveSession' | + 'init' | 'reset' | 'disconnect' | 'initApi' | 'sync' | 'saveSession' | 'showNotification' | 'dismissNotification' | 'showDialog' | 'dismissDialog' | // ui 'toggleChatInfo' | 'setIsUiReady' | 'addRecentEmoji' | 'addRecentSticker' | 'toggleLeftColumn' | @@ -610,12 +615,7 @@ export type ActionTypes = ( 'openCallFallbackConfirm' | 'closeCallFallbackConfirm' | 'inviteToCallFallback' | // stats 'loadStatistics' | 'loadStatisticsAsyncGraph' -); + ); -export interface DispatchOptions { - forceOnHeavyAnimation?: boolean; - // Workaround for iOS gesture history navigation - forceSyncOnIOs?: boolean; -} - -export type GlobalActions = Record void>; +const typed = typify(); +export type GlobalActions = ReturnType; diff --git a/src/hooks/useAudioPlayer.ts b/src/hooks/useAudioPlayer.ts index d1f404a4d..23cd9a0ee 100644 --- a/src/hooks/useAudioPlayer.ts +++ b/src/hooks/useAudioPlayer.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useRef, useState, } from '../lib/teact/teact'; -import { getDispatch, getGlobal } from '../lib/teact/teactn'; +import { getDispatch, getGlobal } from '../modules'; import { register, Track, TrackId } from '../util/audioPlayer'; import useEffectWithPrevDeps from './useEffectWithPrevDeps'; diff --git a/src/hooks/useChatContextActions.ts b/src/hooks/useChatContextActions.ts index f91359ffc..bfbe007a1 100644 --- a/src/hooks/useChatContextActions.ts +++ b/src/hooks/useChatContextActions.ts @@ -1,5 +1,5 @@ import { useMemo } from '../lib/teact/teact'; -import { getDispatch } from '../lib/teact/teactn'; +import { getDispatch } from '../modules'; import { ApiChat, ApiUser } from '../api/types'; diff --git a/src/hooks/useEnsureMessage.ts b/src/hooks/useEnsureMessage.ts index fafef354b..f9dc6158e 100644 --- a/src/hooks/useEnsureMessage.ts +++ b/src/hooks/useEnsureMessage.ts @@ -1,5 +1,5 @@ import { useEffect, useMemo } from '../lib/teact/teact'; -import { getDispatch } from '../lib/teact/teactn'; +import { getDispatch } from '../modules'; import { ApiMessage } from '../api/types'; diff --git a/src/hooks/useHistoryBack.ts b/src/hooks/useHistoryBack.ts index 26aa318c0..7cf5d7c43 100644 --- a/src/hooks/useHistoryBack.ts +++ b/src/hooks/useHistoryBack.ts @@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef } from '../lib/teact/teact'; import { IS_IOS } from '../util/environment'; import usePrevious from './usePrevious'; -import { getDispatch } from '../lib/teact/teactn'; +import { getDispatch } from '../modules'; import { areSortedArraysEqual } from '../util/iteratees'; type HistoryState = { diff --git a/src/hooks/useSendMessageAction.ts b/src/hooks/useSendMessageAction.ts index 3ae695f59..386836a11 100644 --- a/src/hooks/useSendMessageAction.ts +++ b/src/hooks/useSendMessageAction.ts @@ -1,5 +1,5 @@ import { useMemo } from '../lib/teact/teact'; -import { getDispatch } from '../lib/teact/teactn'; +import { getDispatch } from '../modules'; import { ApiSendMessageAction } from '../api/types'; diff --git a/src/index.tsx b/src/index.tsx index dfa47fd9d..914f7ecf1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,9 +1,10 @@ import './util/handleError'; import './util/setupServiceWorker'; -import React, { getDispatch, getGlobal } from './lib/teact/teactn'; +import React from './lib/teact/teact'; import TeactDOM from './lib/teact/teact-dom'; +import { getDispatch, getGlobal } from './modules'; import './global'; import { DEBUG } from './config'; diff --git a/src/lib/teact/teactn.tsx b/src/lib/teact/teactn.tsx index a13e035d6..b6b1c373b 100644 --- a/src/lib/teact/teactn.tsx +++ b/src/lib/teact/teactn.tsx @@ -8,19 +8,26 @@ import generateIdFor from '../../util/generateIdFor'; import { fastRaf, throttleWithTickEnd } from '../../util/schedulers'; import arePropsShallowEqual, { getUnequalProps } from '../../util/arePropsShallowEqual'; import { orderBy } from '../../util/iteratees'; -import { - GlobalState, GlobalActions, ActionTypes, DispatchOptions, -} from '../../global/types'; import { handleError } from '../../util/handleError'; import { isHeavyAnimating } from '../../hooks/useHeavyAnimationCheck'; export default React; -type ActionPayload = AnyLiteral; +type GlobalState = AnyLiteral; +type ActionNames = string; +type ActionPayload = any; + +export interface DispatchOptions { + forceOnHeavyAnimation?: boolean; + // Workaround for iOS gesture history navigation + forceSyncOnIOs?: boolean; +} + +type Actions = Record void>; type Reducer = ( global: GlobalState, - actions: GlobalActions, + actions: Actions, payload: any, ) => GlobalState | void; @@ -30,7 +37,7 @@ let currentGlobal = {} as GlobalState; const reducers: Record = {}; const callbacks: Function[] = [updateContainers]; -const actions = {} as GlobalActions; +const actions = {} as Actions; const containers = new Map; ownProps: Props; @@ -143,7 +150,7 @@ function updateContainers() { } } -export function addReducer(name: ActionTypes, reducer: Reducer) { +export function addReducer(name: ActionNames, reducer: Reducer) { if (!reducers[name]) { reducers[name] = []; @@ -216,6 +223,46 @@ export function withGlobal( }; } +export function typify() { + type NonTypedActionPayloads = { + [ActionName in NonTypedActionNames]: ActionPayload; + }; + + type ProjectActionTypes = + ActionPayloads + & NonTypedActionPayloads; + + type ProjectActionNames = keyof ProjectActionTypes; + + type ProjectActions = { + [ActionName in ProjectActionNames]: ( + payload?: ProjectActionTypes[ActionName], + options?: DispatchOptions, + ) => void; + }; + + type ActionHandlers = { + [ActionName in keyof ProjectActionTypes]: ( + global: ProjectGlobalState, + actions: ProjectActions, + payload: ProjectActionTypes[ActionName], + ) => ProjectGlobalState | void; + }; + + return { + getGlobal: getGlobal as () => ProjectGlobalState, + setGlobal: setGlobal as (state: ProjectGlobalState, options?: DispatchOptions) => void, + getDispatch: getDispatch as () => ProjectActions, + addReducer: addReducer as ( + name: ActionName, + handler: ActionHandlers[ActionName], + ) => void, + withGlobal: withGlobal as ( + mapStateToProps: ((global: ProjectGlobalState, ownProps: OwnProps) => AnyLiteral), + ) => (Component: FC) => FC, + }; +} + if (DEBUG) { (window as any).getGlobal = getGlobal; diff --git a/src/modules/actions/api/bots.ts b/src/modules/actions/api/bots.ts index faceb0cd8..63831c414 100644 --- a/src/modules/actions/api/bots.ts +++ b/src/modules/actions/api/bots.ts @@ -1,6 +1,6 @@ import { addReducer, getDispatch, getGlobal, setGlobal, -} from '../../../lib/teact/teactn'; +} from '../..'; import { ApiChat, ApiContact, ApiUser } from '../../../api/types'; import { InlineBotSettings } from '../../../types'; diff --git a/src/modules/actions/api/calls.async.ts b/src/modules/actions/api/calls.async.ts index 7879cc039..e12e1e62d 100644 --- a/src/modules/actions/api/calls.async.ts +++ b/src/modules/actions/api/calls.async.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { joinGroupCall, startSharingScreen, diff --git a/src/modules/actions/api/chats.ts b/src/modules/actions/api/chats.ts index 784dbf40e..a9a7f563d 100644 --- a/src/modules/actions/api/chats.ts +++ b/src/modules/actions/api/chats.ts @@ -1,6 +1,6 @@ import { addReducer, getDispatch, getGlobal, setGlobal, -} from '../../../lib/teact/teactn'; +} from '../..'; import { ApiChat, ApiUser, ApiChatFolder, MAIN_THREAD_ID, @@ -544,7 +544,7 @@ addReducer('openTelegramLink', (global, actions, payload) => { } const uri = new URL(url.startsWith('http') ? url : `https://${url}`); - const [part1, part2, part3] = uri.pathname.split('/').filter(Boolean).map((l) => decodeURI(l)); + const [part1, part2, part3] = uri.pathname.split('').filter(Boolean).map((l) => decodeURI(l)); const params = Object.fromEntries(uri.searchParams); let hash: string | undefined; diff --git a/src/modules/actions/api/globalSearch.ts b/src/modules/actions/api/globalSearch.ts index 931a1e377..c244a5c89 100644 --- a/src/modules/actions/api/globalSearch.ts +++ b/src/modules/actions/api/globalSearch.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { callApi } from '../../../api/gramjs'; import { ApiChat, ApiGlobalMessageSearchType } from '../../../api/types'; diff --git a/src/modules/actions/api/initial.ts b/src/modules/actions/api/initial.ts index b40835970..0131f25ab 100644 --- a/src/modules/actions/api/initial.ts +++ b/src/modules/actions/api/initial.ts @@ -1,6 +1,6 @@ import { addReducer, getDispatch, getGlobal, setGlobal, -} from '../../../lib/teact/teactn'; +} from '../..'; import { initApi, callApi } from '../../../api/gramjs'; import { GlobalState } from '../../../global/types'; diff --git a/src/modules/actions/api/localSearch.ts b/src/modules/actions/api/localSearch.ts index f7ff973e5..245bda4c5 100644 --- a/src/modules/actions/api/localSearch.ts +++ b/src/modules/actions/api/localSearch.ts @@ -1,6 +1,6 @@ import { addReducer, getDispatch, getGlobal, setGlobal, -} from '../../../lib/teact/teactn'; +} from '../..'; import { ApiChat, MAIN_THREAD_ID } from '../../../api/types'; diff --git a/src/modules/actions/api/management.ts b/src/modules/actions/api/management.ts index 0a7021e81..bafe3ca50 100644 --- a/src/modules/actions/api/management.ts +++ b/src/modules/actions/api/management.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { ManagementProgress } from '../../../types'; import { callApi } from '../../../api/gramjs'; diff --git a/src/modules/actions/api/messages.ts b/src/modules/actions/api/messages.ts index f8934c978..af2aece7d 100644 --- a/src/modules/actions/api/messages.ts +++ b/src/modules/actions/api/messages.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { GlobalActions } from '../../../global/types'; import { diff --git a/src/modules/actions/api/payments.ts b/src/modules/actions/api/payments.ts index ca8460773..8cd6c1408 100644 --- a/src/modules/actions/api/payments.ts +++ b/src/modules/actions/api/payments.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { PaymentStep } from '../../../types'; import { ApiChat } from '../../../api/types'; diff --git a/src/modules/actions/api/reactions.ts b/src/modules/actions/api/reactions.ts index 735e1304d..9d8cbebc8 100644 --- a/src/modules/actions/api/reactions.ts +++ b/src/modules/actions/api/reactions.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { callApi } from '../../../api/gramjs'; import * as mediaLoader from '../../../util/mediaLoader'; import { ApiAppConfig, ApiMediaFormat } from '../../../api/types'; diff --git a/src/modules/actions/api/settings.ts b/src/modules/actions/api/settings.ts index fce7628a3..4b70a5f04 100644 --- a/src/modules/actions/api/settings.ts +++ b/src/modules/actions/api/settings.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { GlobalState } from '../../../global/types'; import { diff --git a/src/modules/actions/api/statistics.ts b/src/modules/actions/api/statistics.ts index 540ba2dd0..fdc617a29 100644 --- a/src/modules/actions/api/statistics.ts +++ b/src/modules/actions/api/statistics.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { callApi } from '../../../api/gramjs'; import { updateStatistics, updateStatisticsGraph } from '../../reducers'; diff --git a/src/modules/actions/api/symbols.ts b/src/modules/actions/api/symbols.ts index b4890fe44..e70437e36 100644 --- a/src/modules/actions/api/symbols.ts +++ b/src/modules/actions/api/symbols.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { ApiSticker } from '../../../api/types'; import { LangCode } from '../../../types'; diff --git a/src/modules/actions/api/sync.ts b/src/modules/actions/api/sync.ts index fb32e4835..69d4c231b 100644 --- a/src/modules/actions/api/sync.ts +++ b/src/modules/actions/api/sync.ts @@ -1,6 +1,6 @@ import { addReducer, getGlobal, setGlobal, getDispatch, -} from '../../../lib/teact/teactn'; +} from '../..'; import { ApiChat, ApiFormattedText, ApiMessage, MAIN_THREAD_ID, diff --git a/src/modules/actions/api/twoFaSettings.ts b/src/modules/actions/api/twoFaSettings.ts index a20c3eec7..24b1a9e35 100644 --- a/src/modules/actions/api/twoFaSettings.ts +++ b/src/modules/actions/api/twoFaSettings.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { callApi } from '../../../api/gramjs'; import { replaceSettings, updateTwoFaSettings } from '../../reducers'; diff --git a/src/modules/actions/api/users.ts b/src/modules/actions/api/users.ts index 0504f0adf..fa75b0506 100644 --- a/src/modules/actions/api/users.ts +++ b/src/modules/actions/api/users.ts @@ -1,6 +1,6 @@ import { addReducer, getDispatch, getGlobal, setGlobal, -} from '../../../lib/teact/teactn'; +} from '../..'; import { ApiUser } from '../../../api/types'; import { ManagementProgress } from '../../../types'; diff --git a/src/modules/actions/apiUpdaters/calls.ts b/src/modules/actions/apiUpdaters/calls.ts index c1b9ab2f7..be405e4c3 100644 --- a/src/modules/actions/apiUpdaters/calls.ts +++ b/src/modules/actions/apiUpdaters/calls.ts @@ -1,11 +1,10 @@ -import { addReducer, getGlobal } from '../../../lib/teact/teactn'; -import { ApiUpdate } from '../../../api/types'; +import { addReducer, getGlobal } from '../..'; import { removeGroupCall, updateGroupCall, updateGroupCallParticipant } from '../../reducers/calls'; import { omit } from '../../../util/iteratees'; import { selectChat } from '../../selectors'; import { updateChat } from '../../reducers'; -addReducer('apiUpdate', (global, actions, update: ApiUpdate) => { +addReducer('apiUpdate', (global, actions, update) => { switch (update['@type']) { case 'updateGroupCall': { if (update.call.connectionState === 'discarded') { diff --git a/src/modules/actions/apiUpdaters/chats.ts b/src/modules/actions/apiUpdaters/chats.ts index 503e01211..d2c992848 100644 --- a/src/modules/actions/apiUpdaters/chats.ts +++ b/src/modules/actions/apiUpdaters/chats.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { ApiUpdate, MAIN_THREAD_ID } from '../../../api/types'; diff --git a/src/modules/actions/apiUpdaters/initial.ts b/src/modules/actions/apiUpdaters/initial.ts index 49c2301af..391b76114 100644 --- a/src/modules/actions/apiUpdaters/initial.ts +++ b/src/modules/actions/apiUpdaters/initial.ts @@ -1,6 +1,6 @@ import { addReducer, getDispatch, getGlobal, setGlobal, -} from '../../../lib/teact/teactn'; +} from '../..'; import { GlobalState } from '../../../global/types'; diff --git a/src/modules/actions/apiUpdaters/messages.ts b/src/modules/actions/apiUpdaters/messages.ts index 322423161..c7982a026 100644 --- a/src/modules/actions/apiUpdaters/messages.ts +++ b/src/modules/actions/apiUpdaters/messages.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { ApiUpdate, ApiMessage, ApiPollResult, ApiThreadInfo, MAIN_THREAD_ID, diff --git a/src/modules/actions/apiUpdaters/misc.ts b/src/modules/actions/apiUpdaters/misc.ts index 0fef90cf2..b3821ea96 100644 --- a/src/modules/actions/apiUpdaters/misc.ts +++ b/src/modules/actions/apiUpdaters/misc.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { ApiUpdate } from '../../../api/types'; import { ApiPrivacyKey, PaymentStep } from '../../../types'; diff --git a/src/modules/actions/apiUpdaters/payments.ts b/src/modules/actions/apiUpdaters/payments.ts index b5469a92f..ff1308cf0 100644 --- a/src/modules/actions/apiUpdaters/payments.ts +++ b/src/modules/actions/apiUpdaters/payments.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer } from '../..'; import { ApiUpdate } from '../../../api/types'; diff --git a/src/modules/actions/apiUpdaters/settings.ts b/src/modules/actions/apiUpdaters/settings.ts index b120d0095..18c7800de 100644 --- a/src/modules/actions/apiUpdaters/settings.ts +++ b/src/modules/actions/apiUpdaters/settings.ts @@ -1,4 +1,4 @@ -import { addReducer, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, setGlobal } from '../..'; import { ApiUpdate } from '../../../api/types'; import { GlobalState } from '../../../global/types'; diff --git a/src/modules/actions/apiUpdaters/symbols.ts b/src/modules/actions/apiUpdaters/symbols.ts index 8254127b0..f09ff5c03 100644 --- a/src/modules/actions/apiUpdaters/symbols.ts +++ b/src/modules/actions/apiUpdaters/symbols.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer } from '../..'; import { ApiUpdate } from '../../../api/types'; diff --git a/src/modules/actions/apiUpdaters/twoFaSettings.ts b/src/modules/actions/apiUpdaters/twoFaSettings.ts index fac10e27a..d62174bcf 100644 --- a/src/modules/actions/apiUpdaters/twoFaSettings.ts +++ b/src/modules/actions/apiUpdaters/twoFaSettings.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer } from '../..'; import { ApiUpdate } from '../../../api/types'; import { GlobalState } from '../../../global/types'; diff --git a/src/modules/actions/apiUpdaters/users.ts b/src/modules/actions/apiUpdaters/users.ts index e6a5c0656..e56b690e3 100644 --- a/src/modules/actions/apiUpdaters/users.ts +++ b/src/modules/actions/apiUpdaters/users.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { ApiUpdate, ApiUserStatus } from '../../../api/types'; diff --git a/src/modules/actions/ui/calls.ts b/src/modules/actions/ui/calls.ts index a523187e4..b6cc5302c 100644 --- a/src/modules/actions/ui/calls.ts +++ b/src/modules/actions/ui/calls.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { selectActiveGroupCall, selectChatGroupCall, selectGroupCall } from '../../selectors/calls'; import { callApi } from '../../../api/gramjs'; import { selectChat } from '../../selectors'; diff --git a/src/modules/actions/ui/chats.ts b/src/modules/actions/ui/chats.ts index 7af1bef64..8d6c6c12f 100644 --- a/src/modules/actions/ui/chats.ts +++ b/src/modules/actions/ui/chats.ts @@ -1,4 +1,4 @@ -import { addReducer, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, setGlobal } from '../..'; import { exitMessageSelectMode, replaceThreadParam, updateCurrentMessageList, diff --git a/src/modules/actions/ui/globalSearch.ts b/src/modules/actions/ui/globalSearch.ts index c7c06e99c..e7e8cadfc 100644 --- a/src/modules/actions/ui/globalSearch.ts +++ b/src/modules/actions/ui/globalSearch.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer } from '../..'; import { updateGlobalSearch, updateGlobalSearchContent } from '../../reducers'; diff --git a/src/modules/actions/ui/initial.ts b/src/modules/actions/ui/initial.ts index 55e7c30b5..a400670a4 100644 --- a/src/modules/actions/ui/initial.ts +++ b/src/modules/actions/ui/initial.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { ANIMATION_LEVEL_MAX } from '../../../config'; import { diff --git a/src/modules/actions/ui/localSearch.ts b/src/modules/actions/ui/localSearch.ts index 79b480c36..b2b3a25f2 100644 --- a/src/modules/actions/ui/localSearch.ts +++ b/src/modules/actions/ui/localSearch.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer } from '../..'; import { updateLocalTextSearch, diff --git a/src/modules/actions/ui/messages.ts b/src/modules/actions/ui/messages.ts index 02e4beb4d..c827533d0 100644 --- a/src/modules/actions/ui/messages.ts +++ b/src/modules/actions/ui/messages.ts @@ -1,4 +1,4 @@ -import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; +import { addReducer, getGlobal, setGlobal } from '../..'; import { ApiMessage, MAIN_THREAD_ID } from '../../../api/types'; import { FocusDirection } from '../../../types'; diff --git a/src/modules/actions/ui/misc.ts b/src/modules/actions/ui/misc.ts index 619a07504..7d1b7f5d9 100644 --- a/src/modules/actions/ui/misc.ts +++ b/src/modules/actions/ui/misc.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer } from '../..'; import { GlobalState } from '../../../global/types'; import { ApiError } from '../../../api/types'; diff --git a/src/modules/actions/ui/payments.ts b/src/modules/actions/ui/payments.ts index 73859dc8b..26d2dbcb0 100644 --- a/src/modules/actions/ui/payments.ts +++ b/src/modules/actions/ui/payments.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer } from '../..'; import { clearPayment, closeInvoice } from '../../reducers'; diff --git a/src/modules/actions/ui/settings.ts b/src/modules/actions/ui/settings.ts index 862cf9383..2be4c0e3b 100644 --- a/src/modules/actions/ui/settings.ts +++ b/src/modules/actions/ui/settings.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer } from '../..'; import { ISettings, IThemeSettings, ThemeKey } from '../../../types'; import { replaceSettings, replaceThemeSettings } from '../../reducers'; diff --git a/src/modules/actions/ui/stickerSearch.ts b/src/modules/actions/ui/stickerSearch.ts index 203d91302..1227ded45 100644 --- a/src/modules/actions/ui/stickerSearch.ts +++ b/src/modules/actions/ui/stickerSearch.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer } from '../..'; addReducer('setStickerSearchQuery', (global, actions, payload) => { const { query } = payload!; diff --git a/src/modules/actions/ui/users.ts b/src/modules/actions/ui/users.ts index 2895dca42..bb469f0b0 100644 --- a/src/modules/actions/ui/users.ts +++ b/src/modules/actions/ui/users.ts @@ -1,4 +1,4 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer } from '../..'; import { updateUserSearch } from '../../reducers'; diff --git a/src/modules/index.ts b/src/modules/index.ts new file mode 100644 index 000000000..d472b0207 --- /dev/null +++ b/src/modules/index.ts @@ -0,0 +1,10 @@ +import { typify } from '../lib/teact/teactn'; +import { GlobalState, ActionPayloads, NonTypedActionNames } from '../global/types'; + +const typed = typify(); + +export const getGlobal = typed.getGlobal; +export const setGlobal = typed.setGlobal; +export const getDispatch = typed.getDispatch; +export const addReducer = typed.addReducer; +export const withGlobal = typed.withGlobal; diff --git a/src/modules/reducers/settings.ts b/src/modules/reducers/settings.ts index 2f70b12f1..1a207d9ce 100644 --- a/src/modules/reducers/settings.ts +++ b/src/modules/reducers/settings.ts @@ -62,6 +62,7 @@ export function addNotifyException( }; } +// eslint-disable-next-line consistent-return export function updateNotifySettings( global: GlobalState, peerType: 'contact' | 'group' | 'broadcast', isSilent?: boolean, shouldShowPreviews?: boolean, ) { @@ -81,9 +82,6 @@ export function updateNotifySettings( ...(typeof isSilent !== 'undefined' && { hasBroadcastNotifications: !isSilent }), ...(typeof shouldShowPreviews !== 'undefined' && { hasBroadcastMessagePreview: shouldShowPreviews }), }); - - default: - return undefined; } } diff --git a/src/util/audioPlayer.ts b/src/util/audioPlayer.ts index 793bc45e4..805ff35c8 100644 --- a/src/util/audioPlayer.ts +++ b/src/util/audioPlayer.ts @@ -1,4 +1,4 @@ -import { getDispatch, getGlobal } from '../lib/teact/teactn'; +import { getDispatch, getGlobal } from '../modules'; import { AudioOrigin, GlobalSearchContent } from '../types'; import { ApiMessage } from '../api/types'; diff --git a/src/util/deeplink.ts b/src/util/deeplink.ts index a5a1a2d26..42544182f 100644 --- a/src/util/deeplink.ts +++ b/src/util/deeplink.ts @@ -1,4 +1,4 @@ -import { getDispatch } from '../lib/teact/teactn'; +import { getDispatch } from '../modules'; import { IS_SAFARI } from './environment'; type DeepLinkMethod = 'resolve' | 'login' | 'passport' | 'settings' | 'join' | 'addstickers' | 'setlanguage' | diff --git a/src/util/fastSmoothScroll.ts b/src/util/fastSmoothScroll.ts index dbc9fb690..20e88314a 100644 --- a/src/util/fastSmoothScroll.ts +++ b/src/util/fastSmoothScroll.ts @@ -1,4 +1,4 @@ -import { getGlobal } from '../lib/teact/teactn'; +import { getGlobal } from '../modules'; import { FocusDirection } from '../types'; diff --git a/src/util/fastSmoothScrollHorizontal.ts b/src/util/fastSmoothScrollHorizontal.ts index 985224450..0377284e0 100644 --- a/src/util/fastSmoothScrollHorizontal.ts +++ b/src/util/fastSmoothScrollHorizontal.ts @@ -1,4 +1,4 @@ -import { getGlobal } from '../lib/teact/teactn'; +import { getGlobal } from '../modules'; import { ANIMATION_LEVEL_MIN } from '../config'; import { animate } from './animation'; diff --git a/src/util/folderManager.ts b/src/util/folderManager.ts index 2664edf51..2a8301bb3 100644 --- a/src/util/folderManager.ts +++ b/src/util/folderManager.ts @@ -1,4 +1,5 @@ -import { addCallback, addReducer, getGlobal } from '../lib/teact/teactn'; +import { addCallback } from '../lib/teact/teactn'; +import { addReducer, getGlobal } from '../modules'; import { GlobalState } from '../global/types'; import { NotifyException, NotifySettings } from '../types'; diff --git a/src/util/langProvider.ts b/src/util/langProvider.ts index 4323e1f09..2b69abca1 100644 --- a/src/util/langProvider.ts +++ b/src/util/langProvider.ts @@ -1,4 +1,4 @@ -import { getGlobal } from '../lib/teact/teactn'; +import { getGlobal } from '../modules'; import { ApiLangPack, ApiLangString } from '../api/types'; import { LangCode, TimeFormat } from '../types'; diff --git a/src/util/notifications.ts b/src/util/notifications.ts index a9ef482f0..e24fdc941 100644 --- a/src/util/notifications.ts +++ b/src/util/notifications.ts @@ -4,7 +4,7 @@ import { } from '../api/types'; import { renderActionMessageText } from '../components/common/helpers/renderActionMessageText'; import { DEBUG, IS_TEST } from '../config'; -import { getDispatch, getGlobal, setGlobal } from '../lib/teact/teactn'; +import { getDispatch, getGlobal, setGlobal } from '../modules'; import { getChatAvatarHash, getChatTitle, diff --git a/src/util/setupServiceWorker.ts b/src/util/setupServiceWorker.ts index ee30844f6..4142aa81f 100644 --- a/src/util/setupServiceWorker.ts +++ b/src/util/setupServiceWorker.ts @@ -1,5 +1,5 @@ import { DEBUG, DEBUG_MORE } from '../config'; -import { getDispatch } from '../lib/teact/teactn'; +import { getDispatch } from '../modules'; import { IS_ANDROID, IS_IOS, IS_SERVICE_WORKER_SUPPORTED } from './environment'; import { notifyClientReady, playNotifySoundDebounced } from './notifications'; diff --git a/src/util/websync.ts b/src/util/websync.ts index 02bdbf313..1f85070ed 100644 --- a/src/util/websync.ts +++ b/src/util/websync.ts @@ -1,5 +1,5 @@ import { APP_VERSION, DEBUG } from '../config'; -import { getGlobal } from '../lib/teact/teactn'; +import { getGlobal } from '../modules'; import { hasStoredSession } from './sessions'; const WEBSYNC_URLS = [