From e204fa36a5c56ad48d800c1d15844af8b8f9995f Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Sat, 19 Mar 2022 21:19:11 +0100 Subject: [PATCH] [Refactoring] Rename `modules/*` -> `global/*` --- src/App.tsx | 2 +- src/bundles/main.ts | 2 +- src/components/auth/Auth.tsx | 4 ++-- src/components/auth/AuthCode.tsx | 2 +- src/components/auth/AuthPassword.tsx | 2 +- src/components/auth/AuthPhoneNumber.tsx | 2 +- src/components/auth/AuthQrCode.tsx | 2 +- src/components/auth/AuthRegister.tsx | 2 +- src/components/auth/CountryCodeInput.tsx | 2 +- src/components/calls/ActiveCallHeader.tsx | 4 ++-- src/components/calls/CallFallbackConfirm.tsx | 8 ++++---- src/components/calls/group/GroupCall.tsx | 6 +++--- .../calls/group/GroupCallParticipant.tsx | 4 ++-- .../calls/group/GroupCallParticipantList.tsx | 4 ++-- .../calls/group/GroupCallParticipantMenu.tsx | 4 ++-- .../group/GroupCallParticipantStreams.tsx | 4 ++-- .../calls/group/GroupCallParticipantVideo.tsx | 4 ++-- .../calls/group/GroupCallTopPane.tsx | 6 +++--- .../calls/group/MicrophoneButton.tsx | 4 ++-- src/components/common/Audio.tsx | 4 ++-- src/components/common/Avatar.tsx | 2 +- src/components/common/ChatExtra.tsx | 6 +++--- src/components/common/ChatLink.tsx | 2 +- src/components/common/ChatOrUserPicker.tsx | 2 +- src/components/common/DeleteChatModal.tsx | 6 +++--- src/components/common/DeleteMessageModal.tsx | 6 +++--- src/components/common/Document.tsx | 4 ++-- src/components/common/EmbeddedMessage.tsx | 2 +- src/components/common/GroupCallLink.tsx | 2 +- src/components/common/GroupChatInfo.tsx | 6 +++--- src/components/common/Media.tsx | 2 +- src/components/common/MessageLink.tsx | 2 +- src/components/common/Picker.tsx | 2 +- src/components/common/PickerSelectedItem.tsx | 6 +++--- src/components/common/PinMessageModal.tsx | 6 +++--- src/components/common/PrivateChatInfo.tsx | 6 +++--- src/components/common/ProfileInfo.tsx | 6 +++--- src/components/common/ProfilePhoto.tsx | 2 +- src/components/common/ReactionStaticEmoji.tsx | 2 +- src/components/common/ReportMessageModal.tsx | 2 +- src/components/common/SafeLink.tsx | 2 +- src/components/common/SeenByModal.tsx | 4 ++-- src/components/common/StickerSetModal.tsx | 6 +++--- src/components/common/TypingStatus.tsx | 6 +++--- src/components/common/UiLoader.tsx | 6 +++--- src/components/common/UserLink.tsx | 2 +- src/components/common/WebLink.tsx | 2 +- .../common/helpers/mediaDimensions.ts | 2 +- .../common/helpers/renderActionMessageText.tsx | 2 +- .../common/helpers/renderMessageText.ts | 2 +- .../common/helpers/renderTextWithEntities.tsx | 2 +- .../common/hooks/useAnimatedEmoji.ts | 4 ++-- src/components/left/ChatFolderModal.tsx | 2 +- src/components/left/LeftColumn.tsx | 2 +- src/components/left/main/Chat.tsx | 6 +++--- src/components/left/main/ChatFolders.tsx | 2 +- src/components/left/main/ChatList.tsx | 2 +- src/components/left/main/ContactList.tsx | 4 ++-- src/components/left/main/EmptyFolder.tsx | 4 ++-- src/components/left/main/LeftMainHeader.tsx | 6 +++--- src/components/left/newChat/NewChatStep1.tsx | 4 ++-- src/components/left/newChat/NewChatStep2.tsx | 2 +- src/components/left/search/AudioResults.tsx | 2 +- src/components/left/search/ChatMessage.tsx | 6 +++--- .../left/search/ChatMessageResults.tsx | 2 +- src/components/left/search/ChatResults.tsx | 4 ++-- src/components/left/search/FileResults.tsx | 4 ++-- src/components/left/search/LeftSearch.tsx | 2 +- .../left/search/LeftSearchResultChat.tsx | 6 +++--- src/components/left/search/LinkResults.tsx | 2 +- src/components/left/search/MediaResults.tsx | 2 +- src/components/left/search/RecentContacts.tsx | 4 ++-- .../search/helpers/createMapStateToProps.ts | 2 +- .../left/search/helpers/getSenderName.ts | 2 +- .../left/settings/BlockUserModal.tsx | 4 ++-- .../left/settings/SettingsDataStorage.tsx | 2 +- .../left/settings/SettingsEditProfile.tsx | 6 +++--- .../left/settings/SettingsGeneral.tsx | 2 +- .../settings/SettingsGeneralBackground.tsx | 4 ++-- .../SettingsGeneralBackgroundColor.tsx | 4 ++-- .../left/settings/SettingsHeader.tsx | 2 +- .../left/settings/SettingsLanguage.tsx | 2 +- src/components/left/settings/SettingsMain.tsx | 4 ++-- .../left/settings/SettingsNotifications.tsx | 2 +- .../left/settings/SettingsPrivacy.tsx | 2 +- .../settings/SettingsPrivacyActiveSessions.tsx | 2 +- .../settings/SettingsPrivacyBlockedUsers.tsx | 4 ++-- .../settings/SettingsPrivacyVisibility.tsx | 2 +- .../SettingsPrivacyVisibilityExceptionList.tsx | 4 ++-- .../left/settings/SettingsQuickReaction.tsx | 2 +- .../folders/SettingsFoldersChatFilters.tsx | 4 ++-- .../folders/SettingsFoldersChatsPicker.tsx | 2 +- .../settings/folders/SettingsFoldersEdit.tsx | 4 ++-- .../settings/folders/SettingsFoldersMain.tsx | 4 ++-- .../left/settings/twoFa/SettingsTwoFa.tsx | 2 +- .../twoFa/SettingsTwoFaCongratulations.tsx | 4 ++-- .../settings/twoFa/SettingsTwoFaEmailCode.tsx | 4 ++-- .../settings/twoFa/SettingsTwoFaEnabled.tsx | 4 ++-- .../twoFa/SettingsTwoFaSkippableForm.tsx | 4 ++-- .../left/settings/twoFa/SettingsTwoFaStart.tsx | 4 ++-- src/components/main/Dialogs.tsx | 2 +- src/components/main/DownloadManager.tsx | 4 ++-- src/components/main/ForwardPicker.tsx | 4 ++-- src/components/main/HistoryCalendar.tsx | 2 +- src/components/main/Main.tsx | 6 +++--- src/components/main/Notifications.tsx | 2 +- src/components/main/SafeLinkModal.tsx | 2 +- src/components/mediaViewer/MediaViewer.tsx | 6 +++--- .../mediaViewer/MediaViewerActions.tsx | 6 +++--- .../mediaViewer/MediaViewerContent.tsx | 6 +++--- src/components/mediaViewer/SenderInfo.tsx | 6 +++--- .../mediaViewer/helpers/ghostAnimation.ts | 2 +- src/components/middle/ActionMessage.tsx | 6 +++--- src/components/middle/AudioPlayer.tsx | 6 +++--- src/components/middle/ContactGreeting.tsx | 6 +++--- .../middle/DeleteSelectedMessageModal.tsx | 6 +++--- .../middle/EmojiInteractionAnimation.tsx | 4 ++-- src/components/middle/HeaderActions.tsx | 6 +++--- src/components/middle/HeaderMenuContainer.tsx | 6 +++--- src/components/middle/HeaderPinnedMessage.tsx | 2 +- src/components/middle/MessageList.tsx | 6 +++--- src/components/middle/MessageListContent.tsx | 4 ++-- src/components/middle/MessageSelectToolbar.tsx | 4 ++-- src/components/middle/MiddleColumn.tsx | 6 +++--- src/components/middle/MiddleHeader.tsx | 6 +++--- src/components/middle/MobileSearch.tsx | 4 ++-- src/components/middle/ReactorListModal.tsx | 6 +++--- src/components/middle/ScrollDownButton.tsx | 4 ++-- src/components/middle/UserReportPanel.tsx | 6 +++--- .../middle/composer/BotCommandMenu.tsx | 2 +- .../middle/composer/BotCommandTooltip.tsx | 2 +- .../middle/composer/BotKeyboardMenu.tsx | 4 ++-- src/components/middle/composer/Composer.tsx | 6 +++--- .../composer/ComposerEmbeddedMessage.tsx | 6 +++--- src/components/middle/composer/EmojiPicker.tsx | 2 +- src/components/middle/composer/GifPicker.tsx | 2 +- .../middle/composer/InlineBotTooltip.tsx | 2 +- .../middle/composer/MentionTooltip.tsx | 2 +- .../middle/composer/MessageInput.tsx | 4 ++-- src/components/middle/composer/SendAsMenu.tsx | 4 ++-- .../middle/composer/StickerPicker.tsx | 2 +- .../middle/composer/StickerTooltip.tsx | 2 +- src/components/middle/composer/SymbolMenu.tsx | 2 +- .../middle/composer/WebPagePreview.tsx | 4 ++-- .../middle/composer/hooks/useDraft.ts | 2 +- .../middle/composer/hooks/useEditing.ts | 4 ++-- .../composer/hooks/useInlineBotTooltip.ts | 2 +- .../middle/composer/hooks/useMentionTooltip.ts | 4 ++-- .../middle/composer/hooks/useStickerTooltip.ts | 2 +- src/components/middle/helpers/groupMessages.ts | 2 +- .../middle/hooks/useMessageObservers.ts | 2 +- src/components/middle/hooks/useScrollHooks.ts | 2 +- src/components/middle/message/Album.tsx | 6 +++--- .../middle/message/CommentButton.tsx | 4 ++-- src/components/middle/message/Contact.tsx | 4 ++-- .../middle/message/ContextMenuContainer.tsx | 6 +++--- src/components/middle/message/Invoice.tsx | 2 +- src/components/middle/message/Location.tsx | 2 +- src/components/middle/message/MentionLink.tsx | 4 ++-- src/components/middle/message/Message.tsx | 6 +++--- .../middle/message/MessageContextMenu.tsx | 2 +- src/components/middle/message/Photo.tsx | 2 +- src/components/middle/message/Poll.tsx | 2 +- .../middle/message/ReactionAnimatedEmoji.tsx | 2 +- .../middle/message/ReactionButton.tsx | 2 +- src/components/middle/message/RoundVideo.tsx | 4 ++-- .../middle/message/SponsoredMessage.tsx | 6 +++--- src/components/middle/message/Sticker.tsx | 2 +- src/components/middle/message/Video.tsx | 4 ++-- src/components/middle/message/WebPage.tsx | 2 +- .../message/helpers/buildContentClassName.ts | 2 +- .../middle/message/helpers/copyOptions.ts | 2 +- .../middle/message/helpers/mediaDimensions.ts | 2 +- .../middle/message/hocs/withSelectControl.tsx | 4 ++-- .../message/hooks/useBlurredMediaThumbRef.ts | 2 +- .../middle/message/hooks/useInnerHandlers.ts | 2 +- .../middle/message/hooks/useOuterHandlers.ts | 2 +- src/components/payment/PaymentModal.tsx | 2 +- src/components/payment/ReceiptModal.tsx | 2 +- src/components/right/AddChatMembers.tsx | 6 +++--- src/components/right/DeleteMemberModal.tsx | 6 +++--- src/components/right/GifSearch.tsx | 6 +++--- src/components/right/PollAnswerResults.tsx | 2 +- src/components/right/PollResults.tsx | 6 +++--- src/components/right/Profile.tsx | 6 +++--- src/components/right/RightColumn.tsx | 4 ++-- src/components/right/RightHeader.tsx | 6 +++--- src/components/right/RightSearch.tsx | 6 +++--- src/components/right/StickerSearch.tsx | 4 ++-- src/components/right/StickerSetResult.tsx | 4 ++-- .../right/hooks/useProfileViewportIds.ts | 2 +- .../right/management/JoinRequest.tsx | 6 +++--- .../right/management/ManageChannel.tsx | 6 +++--- .../management/ManageChatAdministrators.tsx | 6 +++--- .../right/management/ManageChatPrivacyType.tsx | 6 +++--- .../management/ManageChatRemovedUsers.tsx | 6 +++--- .../right/management/ManageDiscussion.tsx | 6 +++--- .../right/management/ManageGroup.tsx | 6 +++--- .../management/ManageGroupAdminRights.tsx | 6 +++--- .../right/management/ManageGroupMembers.tsx | 6 +++--- .../management/ManageGroupPermissions.tsx | 4 ++-- .../management/ManageGroupRecentActions.tsx | 4 ++-- .../management/ManageGroupUserPermissions.tsx | 4 ++-- .../ManageGroupUserPermissionsCreate.tsx | 6 +++--- .../right/management/ManageInvite.tsx | 2 +- .../right/management/ManageInviteInfo.tsx | 6 +++--- .../right/management/ManageInvites.tsx | 6 +++--- .../right/management/ManageJoinRequests.tsx | 6 +++--- .../right/management/ManageReactions.tsx | 4 ++-- src/components/right/management/ManageUser.tsx | 6 +++--- src/components/right/management/Management.tsx | 4 ++-- .../right/management/RemoveGroupUserModal.tsx | 4 ++-- src/components/right/statistics/Statistics.tsx | 4 ++-- .../statistics/StatisticsRecentMessage.tsx | 2 +- src/components/test/ErrorTest.tsx | 2 +- src/components/test/Test.tsx | 2 +- src/components/test/TestNoRedundancy.tsx | 2 +- src/components/ui/Transition.tsx | 2 +- src/{modules => global}/actions/all.ts | 0 src/{modules => global}/actions/api/bots.ts | 2 +- .../actions/api/calls.async.ts | 2 +- src/{modules => global}/actions/api/chats.ts | 6 +++--- .../actions/api/globalSearch.ts | 2 +- src/{modules => global}/actions/api/initial.ts | 4 ++-- .../actions/api/localSearch.ts | 2 +- .../actions/api/management.ts | 2 +- .../actions/api/messages.ts | 4 ++-- .../actions/api/payments.ts | 2 +- .../actions/api/reactions.ts | 2 +- .../actions/api/settings.ts | 4 ++-- .../actions/api/statistics.ts | 2 +- src/{modules => global}/actions/api/symbols.ts | 2 +- src/{modules => global}/actions/api/sync.ts | 2 +- .../actions/api/twoFaSettings.ts | 2 +- src/{modules => global}/actions/api/users.ts | 2 +- .../actions/apiUpdaters/calls.ts | 2 +- .../actions/apiUpdaters/chats.ts | 2 +- .../actions/apiUpdaters/initial.ts | 4 ++-- .../actions/apiUpdaters/messages.ts | 4 ++-- .../actions/apiUpdaters/misc.ts | 2 +- .../actions/apiUpdaters/payments.ts | 2 +- .../actions/apiUpdaters/settings.ts | 4 ++-- .../actions/apiUpdaters/symbols.ts | 2 +- .../actions/apiUpdaters/twoFaSettings.ts | 4 ++-- .../actions/apiUpdaters/users.ts | 2 +- src/{modules => global}/actions/calls.ts | 0 src/{modules => global}/actions/initial.ts | 0 src/{modules => global}/actions/ui/calls.ts | 2 +- src/{modules => global}/actions/ui/chats.ts | 2 +- .../actions/ui/globalSearch.ts | 2 +- src/{modules => global}/actions/ui/initial.ts | 2 +- .../actions/ui/localSearch.ts | 4 ++-- src/{modules => global}/actions/ui/messages.ts | 4 ++-- src/{modules => global}/actions/ui/misc.ts | 4 ++-- src/{modules => global}/actions/ui/payments.ts | 2 +- src/{modules => global}/actions/ui/settings.ts | 2 +- .../actions/ui/stickerSearch.ts | 2 +- src/{modules => global}/actions/ui/users.ts | 2 +- src/global/cache.ts | 8 ++++---- src/{modules => global}/helpers/chats.ts | 0 src/{modules => global}/helpers/index.ts | 0 src/{modules => global}/helpers/localSearch.ts | 0 .../helpers/messageMedia.ts | 0 .../helpers/messageSummary.ts | 0 src/{modules => global}/helpers/messages.ts | 0 src/{modules => global}/helpers/payments.ts | 0 src/{modules => global}/helpers/reactions.ts | 0 src/{modules => global}/helpers/users.ts | 0 src/global/index.ts | 18 ++++++++---------- src/global/init.ts | 12 ++++++++++++ src/global/{initial.ts => initialState.ts} | 0 src/{modules => global}/reducers/bots.ts | 2 +- src/{modules => global}/reducers/calls.ts | 2 +- src/{modules => global}/reducers/chats.ts | 2 +- .../reducers/globalSearch.ts | 2 +- src/{modules => global}/reducers/index.ts | 0 .../reducers/localSearch.ts | 2 +- src/{modules => global}/reducers/management.ts | 2 +- src/{modules => global}/reducers/messages.ts | 2 +- src/{modules => global}/reducers/payments.ts | 2 +- src/{modules => global}/reducers/reactions.ts | 2 +- src/{modules => global}/reducers/settings.ts | 2 +- src/{modules => global}/reducers/statistics.ts | 2 +- src/{modules => global}/reducers/symbols.ts | 2 +- .../reducers/twoFaSettings.ts | 2 +- src/{modules => global}/reducers/users.ts | 2 +- src/{modules => global}/selectors/calls.ts | 2 +- src/{modules => global}/selectors/chats.ts | 2 +- .../selectors/globalSearch.ts | 2 +- src/{modules => global}/selectors/index.ts | 0 .../selectors/localSearch.ts | 2 +- .../selectors/management.ts | 2 +- src/{modules => global}/selectors/messages.ts | 2 +- src/{modules => global}/selectors/payments.ts | 2 +- src/{modules => global}/selectors/settings.ts | 2 +- .../selectors/statistics.ts | 2 +- src/{modules => global}/selectors/symbols.ts | 2 +- src/{modules => global}/selectors/ui.ts | 2 +- src/{modules => global}/selectors/users.ts | 2 +- src/hooks/useAudioPlayer.ts | 2 +- src/hooks/useChatContextActions.ts | 4 ++-- src/hooks/useEnsureMessage.ts | 2 +- src/hooks/useHistoryBack.ts | 2 +- src/hooks/useMessageMediaMetadata.ts | 2 +- src/hooks/useSendMessageAction.ts | 2 +- src/hooks/useWebpThumbnail.ts | 2 +- src/index.tsx | 4 ++-- src/modules/index.ts | 10 ---------- src/util/audioPlayer.ts | 6 +++--- src/util/deeplink.ts | 2 +- src/util/fastSmoothScroll.ts | 2 +- src/util/fastSmoothScrollHorizontal.ts | 2 +- src/util/folderManager.ts | 6 +++--- src/util/langProvider.ts | 2 +- src/util/notifications.ts | 8 ++++---- src/util/setupServiceWorker.ts | 2 +- src/util/websync.ts | 2 +- 317 files changed, 529 insertions(+), 529 deletions(-) rename src/{modules => global}/actions/all.ts (100%) rename src/{modules => global}/actions/api/bots.ts (99%) rename src/{modules => global}/actions/api/calls.async.ts (99%) rename src/{modules => global}/actions/api/chats.ts (99%) rename src/{modules => global}/actions/api/globalSearch.ts (98%) rename src/{modules => global}/actions/api/initial.ts (98%) rename src/{modules => global}/actions/api/localSearch.ts (99%) rename src/{modules => global}/actions/api/management.ts (99%) rename src/{modules => global}/actions/api/messages.ts (99%) rename src/{modules => global}/actions/api/payments.ts (99%) rename src/{modules => global}/actions/api/reactions.ts (99%) rename src/{modules => global}/actions/api/settings.ts (99%) rename src/{modules => global}/actions/api/statistics.ts (95%) rename src/{modules => global}/actions/api/symbols.ts (99%) rename src/{modules => global}/actions/api/sync.ts (99%) rename src/{modules => global}/actions/api/twoFaSettings.ts (97%) rename src/{modules => global}/actions/api/users.ts (99%) rename src/{modules => global}/actions/apiUpdaters/calls.ts (96%) rename src/{modules => global}/actions/apiUpdaters/chats.ts (99%) rename src/{modules => global}/actions/apiUpdaters/initial.ts (98%) rename src/{modules => global}/actions/apiUpdaters/messages.ts (99%) rename src/{modules => global}/actions/apiUpdaters/misc.ts (94%) rename src/{modules => global}/actions/apiUpdaters/payments.ts (86%) rename src/{modules => global}/actions/apiUpdaters/settings.ts (88%) rename src/{modules => global}/actions/apiUpdaters/symbols.ts (87%) rename src/{modules => global}/actions/apiUpdaters/twoFaSettings.ts (86%) rename src/{modules => global}/actions/apiUpdaters/users.ts (95%) rename src/{modules => global}/actions/calls.ts (100%) rename src/{modules => global}/actions/initial.ts (100%) rename src/{modules => global}/actions/ui/calls.ts (99%) rename src/{modules => global}/actions/ui/chats.ts (97%) rename src/{modules => global}/actions/ui/globalSearch.ts (96%) rename src/{modules => global}/actions/ui/initial.ts (98%) rename src/{modules => global}/actions/ui/localSearch.ts (95%) rename src/{modules => global}/actions/ui/messages.ts (99%) rename src/{modules => global}/actions/ui/misc.ts (98%) rename src/{modules => global}/actions/ui/payments.ts (93%) rename src/{modules => global}/actions/ui/settings.ts (91%) rename src/{modules => global}/actions/ui/stickerSearch.ts (91%) rename src/{modules => global}/actions/ui/users.ts (86%) rename src/{modules => global}/helpers/chats.ts (100%) rename src/{modules => global}/helpers/index.ts (100%) rename src/{modules => global}/helpers/localSearch.ts (100%) rename src/{modules => global}/helpers/messageMedia.ts (100%) rename src/{modules => global}/helpers/messageSummary.ts (100%) rename src/{modules => global}/helpers/messages.ts (100%) rename src/{modules => global}/helpers/payments.ts (100%) rename src/{modules => global}/helpers/reactions.ts (100%) rename src/{modules => global}/helpers/users.ts (100%) create mode 100644 src/global/init.ts rename src/global/{initial.ts => initialState.ts} (100%) rename src/{modules => global}/reducers/bots.ts (92%) rename src/{modules => global}/reducers/calls.ts (98%) rename src/{modules => global}/reducers/chats.ts (99%) rename src/{modules => global}/reducers/globalSearch.ts (97%) rename src/{modules => global}/reducers/index.ts (100%) rename src/{modules => global}/reducers/localSearch.ts (98%) rename src/{modules => global}/reducers/management.ts (92%) rename src/{modules => global}/reducers/messages.ts (99%) rename src/{modules => global}/reducers/payments.ts (98%) rename src/{modules => global}/reducers/reactions.ts (97%) rename src/{modules => global}/reducers/settings.ts (98%) rename src/{modules => global}/reducers/statistics.ts (93%) rename src/{modules => global}/reducers/symbols.ts (98%) rename src/{modules => global}/reducers/twoFaSettings.ts (81%) rename src/{modules => global}/reducers/users.ts (99%) rename src/{modules => global}/selectors/calls.ts (96%) rename src/{modules => global}/selectors/chats.ts (99%) rename src/{modules => global}/selectors/globalSearch.ts (68%) rename src/{modules => global}/selectors/index.ts (100%) rename src/{modules => global}/selectors/localSearch.ts (93%) rename src/{modules => global}/selectors/management.ts (95%) rename src/{modules => global}/selectors/messages.ts (99%) rename src/{modules => global}/selectors/payments.ts (94%) rename src/{modules => global}/selectors/settings.ts (80%) rename src/{modules => global}/selectors/statistics.ts (91%) rename src/{modules => global}/selectors/symbols.ts (98%) rename src/{modules => global}/selectors/ui.ts (97%) rename src/{modules => global}/selectors/users.ts (96%) delete mode 100644 src/modules/index.ts diff --git a/src/App.tsx b/src/App.tsx index 2c1a7cc99..ba04ea8a2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,5 @@ import React, { FC, useEffect } from './lib/teact/teact'; -import { getActions, withGlobal } from './modules'; +import { getActions, withGlobal } from './global'; import { GlobalState } from './global/types'; diff --git a/src/bundles/main.ts b/src/bundles/main.ts index 2ff33f6eb..4203958c6 100644 --- a/src/bundles/main.ts +++ b/src/bundles/main.ts @@ -1,4 +1,4 @@ -import { getActions, getGlobal } from '../modules'; +import { getActions, getGlobal } from '../global'; import { DEBUG } from '../config'; diff --git a/src/components/auth/Auth.tsx b/src/components/auth/Auth.tsx index 921e4a826..920112db1 100644 --- a/src/components/auth/Auth.tsx +++ b/src/components/auth/Auth.tsx @@ -1,9 +1,9 @@ import React, { FC, useEffect, memo } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { GlobalState } from '../../global/types'; -import '../../modules/actions/initial'; +import '../../global/actions/initial'; import { pick } from '../../util/iteratees'; import { PLATFORM_ENV } from '../../util/environment'; import windowSize from '../../util/windowSize'; diff --git a/src/components/auth/AuthCode.tsx b/src/components/auth/AuthCode.tsx index 9a8f9e554..c32fe5d18 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; 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 3c2f70796..f704b1d34 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { GlobalState } from '../../global/types'; diff --git a/src/components/auth/AuthPhoneNumber.tsx b/src/components/auth/AuthPhoneNumber.tsx index b80d20fba..fa9022ae7 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { GlobalState } from '../../global/types'; import { LangCode } from '../../types'; diff --git a/src/components/auth/AuthQrCode.tsx b/src/components/auth/AuthQrCode.tsx index 4f0b5c107..f09eaccec 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { GlobalState } from '../../global/types'; import { LangCode } from '../../types'; diff --git a/src/components/auth/AuthRegister.tsx b/src/components/auth/AuthRegister.tsx index 88b54865c..566414578 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { GlobalState } from '../../global/types'; diff --git a/src/components/auth/CountryCodeInput.tsx b/src/components/auth/CountryCodeInput.tsx index 655c55347..7f1a57a02 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 '../../modules'; +import { withGlobal } from '../../global'; import { ApiCountryCode } from '../../api/types'; diff --git a/src/components/calls/ActiveCallHeader.tsx b/src/components/calls/ActiveCallHeader.tsx index a011cf175..5d3be4d3b 100644 --- a/src/components/calls/ActiveCallHeader.tsx +++ b/src/components/calls/ActiveCallHeader.tsx @@ -2,11 +2,11 @@ import { GroupCallParticipant } from '../../lib/secret-sauce'; import React, { FC, memo, useEffect, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiGroupCall } from '../../api/types'; -import { selectActiveGroupCall, selectGroupCallParticipant } from '../../modules/selectors/calls'; +import { selectActiveGroupCall, selectGroupCallParticipant } from '../../global/selectors/calls'; import buildClassName from '../../util/buildClassName'; import useLang from '../../hooks/useLang'; diff --git a/src/components/calls/CallFallbackConfirm.tsx b/src/components/calls/CallFallbackConfirm.tsx index 42a010458..d455846c8 100644 --- a/src/components/calls/CallFallbackConfirm.tsx +++ b/src/components/calls/CallFallbackConfirm.tsx @@ -1,11 +1,11 @@ import React, { FC, memo, useState } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import ConfirmDialog from '../ui/ConfirmDialog'; import Checkbox from '../ui/Checkbox'; -import { selectCallFallbackChannelTitle } from '../../modules/selectors/calls'; -import { getUserFullName } from '../../modules/helpers'; -import { selectCurrentMessageList, selectUser } from '../../modules/selectors'; +import { selectCallFallbackChannelTitle } from '../../global/selectors/calls'; +import { getUserFullName } from '../../global/helpers'; +import { selectCurrentMessageList, selectUser } from '../../global/selectors'; import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; export type OwnProps = { diff --git a/src/components/calls/group/GroupCall.tsx b/src/components/calls/group/GroupCall.tsx index d08a7865d..ccfe05aea 100644 --- a/src/components/calls/group/GroupCall.tsx +++ b/src/components/calls/group/GroupCall.tsx @@ -5,8 +5,8 @@ import { import React, { FC, memo, useCallback, useEffect, useMemo, useRef, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; -import '../../../modules/actions/calls'; +import { getActions, withGlobal } from '../../../global'; +import '../../../global/actions/calls'; import { IAnchorPosition } from '../../../types'; @@ -21,7 +21,7 @@ import { selectGroupCall, selectGroupCallParticipant, selectIsAdminInActiveGroupCall, -} from '../../../modules/selectors/calls'; +} from '../../../global/selectors/calls'; import useFlag from '../../../hooks/useFlag'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/calls/group/GroupCallParticipant.tsx b/src/components/calls/group/GroupCallParticipant.tsx index 3d499be84..8809b9918 100644 --- a/src/components/calls/group/GroupCallParticipant.tsx +++ b/src/components/calls/group/GroupCallParticipant.tsx @@ -2,12 +2,12 @@ import { GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../ import React, { FC, memo, useMemo, useRef, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../modules'; +import { withGlobal } from '../../../global'; import { ApiChat, ApiUser } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; -import { selectChat, selectUser } from '../../../modules/selectors'; +import { selectChat, selectUser } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; import { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config'; diff --git a/src/components/calls/group/GroupCallParticipantList.tsx b/src/components/calls/group/GroupCallParticipantList.tsx index d01d0c55a..db20af064 100644 --- a/src/components/calls/group/GroupCallParticipantList.tsx +++ b/src/components/calls/group/GroupCallParticipantList.tsx @@ -1,9 +1,9 @@ import { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce'; import React, { FC, memo, useMemo } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import useLang from '../../../hooks/useLang'; -import { selectActiveGroupCall } from '../../../modules/selectors/calls'; +import { selectActiveGroupCall } from '../../../global/selectors/calls'; import useInfiniteScroll from '../../../hooks/useInfiniteScroll'; import GroupCallParticipant from './GroupCallParticipant'; diff --git a/src/components/calls/group/GroupCallParticipantMenu.tsx b/src/components/calls/group/GroupCallParticipantMenu.tsx index 3a3da0be1..45c1de0f5 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { IAnchorPosition } from '../../../types'; @@ -10,7 +10,7 @@ import buildClassName from '../../../util/buildClassName'; import useThrottle from '../../../hooks/useThrottle'; import useFlag from '../../../hooks/useFlag'; import useLang from '../../../hooks/useLang'; -import { selectIsAdminInActiveGroupCall } from '../../../modules/selectors/calls'; +import { selectIsAdminInActiveGroupCall } from '../../../global/selectors/calls'; import { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config'; import Menu from '../../ui/Menu'; diff --git a/src/components/calls/group/GroupCallParticipantStreams.tsx b/src/components/calls/group/GroupCallParticipantStreams.tsx index cd497f88a..c7570a05e 100644 --- a/src/components/calls/group/GroupCallParticipantStreams.tsx +++ b/src/components/calls/group/GroupCallParticipantStreams.tsx @@ -2,9 +2,9 @@ import { GroupCallParticipant } from '../../../lib/secret-sauce'; import React, { FC, memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../modules'; +import { withGlobal } from '../../../global'; import GroupCallParticipantVideo from './GroupCallParticipantVideo'; -import { selectActiveGroupCall } from '../../../modules/selectors/calls'; +import { selectActiveGroupCall } from '../../../global/selectors/calls'; import buildClassName from '../../../util/buildClassName'; type OwnProps = { diff --git a/src/components/calls/group/GroupCallParticipantVideo.tsx b/src/components/calls/group/GroupCallParticipantVideo.tsx index d9918cb7f..dbf6ed1b3 100644 --- a/src/components/calls/group/GroupCallParticipantVideo.tsx +++ b/src/components/calls/group/GroupCallParticipantVideo.tsx @@ -1,11 +1,11 @@ import { getUserStreams, GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce'; import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../modules'; +import { withGlobal } from '../../../global'; import { ApiChat, ApiUser } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; -import { selectChat, selectUser } from '../../../modules/selectors'; +import { selectChat, selectUser } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; import { ENABLE_THUMBNAIL_VIDEO } from '../../../config'; diff --git a/src/components/calls/group/GroupCallTopPane.tsx b/src/components/calls/group/GroupCallTopPane.tsx index f8d4ac2cc..0696b237f 100644 --- a/src/components/calls/group/GroupCallTopPane.tsx +++ b/src/components/calls/group/GroupCallTopPane.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useCallback, useEffect, useMemo, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat, ApiGroupCall, ApiUser } from '../../../api/types'; -import { selectChatGroupCall } from '../../../modules/selectors/calls'; +import { selectChatGroupCall } from '../../../global/selectors/calls'; import buildClassName from '../../../util/buildClassName'; -import { selectChat } from '../../../modules/selectors'; +import { selectChat } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; import Button from '../../ui/Button'; diff --git a/src/components/calls/group/MicrophoneButton.tsx b/src/components/calls/group/MicrophoneButton.tsx index 592cc2788..63b5546ea 100644 --- a/src/components/calls/group/MicrophoneButton.tsx +++ b/src/components/calls/group/MicrophoneButton.tsx @@ -2,12 +2,12 @@ import { GroupCallConnectionState } from '../../../lib/secret-sauce'; import React, { FC, memo, useEffect, useMemo, useRef, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import buildClassName from '../../../util/buildClassName'; import { vibrateShort } from '../../../util/vibrate'; import usePrevious from '../../../hooks/usePrevious'; -import { selectActiveGroupCall, selectGroupCallParticipant } from '../../../modules/selectors/calls'; +import { selectActiveGroupCall, selectGroupCallParticipant } from '../../../global/selectors/calls'; import useLang from '../../../hooks/useLang'; import AnimatedIcon from '../../common/AnimatedIcon'; diff --git a/src/components/common/Audio.tsx b/src/components/common/Audio.tsx index da313de9e..db026338c 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 { getActions } from '../../modules'; +import { getActions } from '../../global'; import { ApiAudio, ApiMediaFormat, ApiMessage, ApiVoice, @@ -17,7 +17,7 @@ import { getMessageMediaHash, isMessageLocal, isOwnMessage, -} from '../../modules/helpers'; +} from '../../global/helpers'; import { MAX_EMPTY_WAVEFORM_POINTS, renderWaveform } from './helpers/waveform'; import buildClassName from '../../util/buildClassName'; import renderText from './helpers/renderText'; diff --git a/src/components/common/Avatar.tsx b/src/components/common/Avatar.tsx index 8e3ac2b76..26e2699db 100644 --- a/src/components/common/Avatar.tsx +++ b/src/components/common/Avatar.tsx @@ -15,7 +15,7 @@ import { isChatWithRepliesBot, isDeletedUser, isUserOnline, -} from '../../modules/helpers'; +} from '../../global/helpers'; import { getFirstLetters } from '../../util/textFormat'; import buildClassName from '../../util/buildClassName'; import renderText from './helpers/renderText'; diff --git a/src/components/common/ChatExtra.tsx b/src/components/common/ChatExtra.tsx index 86b19f53e..f90dd33a6 100644 --- a/src/components/common/ChatExtra.tsx +++ b/src/components/common/ChatExtra.tsx @@ -1,17 +1,17 @@ import React, { FC, memo, useCallback, useEffect, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { GlobalState } from '../../global/types'; import { ApiChat, ApiCountryCode, ApiUser } from '../../api/types'; import { selectChat, selectNotifyExceptions, selectNotifySettings, selectUser, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { getChatDescription, getChatLink, getHasAdminRight, isChatChannel, isUserId, isUserRightBanned, selectIsChatMuted, -} from '../../modules/helpers'; +} from '../../global/helpers'; import renderText from './helpers/renderText'; import { copyTextToClipboard } from '../../util/clipboard'; import { formatPhoneNumberWithCode } from '../../util/phoneNumber'; diff --git a/src/components/common/ChatLink.tsx b/src/components/common/ChatLink.tsx index 7354ffaca..559348c9f 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 { getActions } from '../../modules'; +import { getActions } from '../../global'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/common/ChatOrUserPicker.tsx b/src/components/common/ChatOrUserPicker.tsx index fbc3c2c27..14bd1c46c 100644 --- a/src/components/common/ChatOrUserPicker.tsx +++ b/src/components/common/ChatOrUserPicker.tsx @@ -8,7 +8,7 @@ import useInfiniteScroll from '../../hooks/useInfiniteScroll'; import useLang from '../../hooks/useLang'; import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation'; import useInputFocusOnOpen from '../../hooks/useInputFocusOnOpen'; -import { isUserId } from '../../modules/helpers'; +import { isUserId } from '../../global/helpers'; import Loading from '../ui/Loading'; import Modal from '../ui/Modal'; diff --git a/src/components/common/DeleteChatModal.tsx b/src/components/common/DeleteChatModal.tsx index b0cec612d..7024cc789 100644 --- a/src/components/common/DeleteChatModal.tsx +++ b/src/components/common/DeleteChatModal.tsx @@ -1,9 +1,9 @@ import React, { FC, useCallback, memo } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChat } from '../../api/types'; -import { selectIsChatWithSelf, selectUser } from '../../modules/selectors'; +import { selectIsChatWithSelf, selectUser } from '../../global/selectors'; import { isUserId, isUserBot, @@ -13,7 +13,7 @@ import { isChatSuperGroup, isChatChannel, getChatTitle, -} from '../../modules/helpers'; +} from '../../global/helpers'; import useLang from '../../hooks/useLang'; import renderText from './helpers/renderText'; diff --git a/src/components/common/DeleteMessageModal.tsx b/src/components/common/DeleteMessageModal.tsx index 97331ee7b..35255e50f 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiMessage } from '../../api/types'; import { IAlbum } from '../../types'; @@ -9,14 +9,14 @@ import { selectChat, selectCurrentMessageList, selectUser, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { isUserId, getUserFirstOrLastName, getPrivateChatUserId, isChatBasicGroup, isChatSuperGroup, -} from '../../modules/helpers'; +} from '../../global/helpers'; import renderText from './helpers/renderText'; import useLang from '../../hooks/useLang'; diff --git a/src/components/common/Document.tsx b/src/components/common/Document.tsx index d4c9f6fab..71fe9bb9d 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 { getActions } from '../../modules'; +import { getActions } from '../../global'; import { ApiMessage } from '../../api/types'; @@ -11,7 +11,7 @@ import { getMessageMediaHash, getMessageMediaThumbDataUri, isMessageDocumentVideo, -} from '../../modules/helpers'; +} from '../../global/helpers'; import { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver'; import useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress'; import useMedia from '../../hooks/useMedia'; diff --git a/src/components/common/EmbeddedMessage.tsx b/src/components/common/EmbeddedMessage.tsx index 909d153f9..e168182dc 100644 --- a/src/components/common/EmbeddedMessage.tsx +++ b/src/components/common/EmbeddedMessage.tsx @@ -7,7 +7,7 @@ import { isActionMessage, getSenderTitle, getMessageRoundVideo, -} from '../../modules/helpers'; +} from '../../global/helpers'; import renderText from './helpers/renderText'; import { getPictogramDimensions } from './helpers/mediaDimensions'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/common/GroupCallLink.tsx b/src/components/common/GroupCallLink.tsx index 9f9d2e670..2aefc296c 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 { getActions } from '../../modules'; +import { getActions } from '../../global'; type OwnProps = { className?: string; diff --git a/src/components/common/GroupChatInfo.tsx b/src/components/common/GroupChatInfo.tsx index fead0cdaf..6043dd454 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChat, ApiTypingStatus } from '../../api/types'; import { GlobalState } from '../../global/types'; @@ -12,8 +12,8 @@ import { getChatTypeString, getChatTitle, isChatSuperGroup, -} from '../../modules/helpers'; -import { selectChat, selectChatMessages, selectChatOnlineCount } from '../../modules/selectors'; +} from '../../global/helpers'; +import { selectChat, selectChatMessages, selectChatOnlineCount } from '../../global/selectors'; import renderText from './helpers/renderText'; import useLang, { LangFn } from '../../hooks/useLang'; diff --git a/src/components/common/Media.tsx b/src/components/common/Media.tsx index 7e950b7a7..21232b397 100644 --- a/src/components/common/Media.tsx +++ b/src/components/common/Media.tsx @@ -11,7 +11,7 @@ import { getMessageMediaHash, getMessageMediaThumbDataUri, getMessageVideo, -} from '../../modules/helpers'; +} from '../../global/helpers'; import buildClassName from '../../util/buildClassName'; import useMedia from '../../hooks/useMedia'; import useMediaTransition from '../../hooks/useMediaTransition'; diff --git a/src/components/common/MessageLink.tsx b/src/components/common/MessageLink.tsx index 949daeed7..2c659b73c 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 { getActions } from '../../modules'; +import { getActions } from '../../global'; import { ApiMessage } from '../../api/types'; diff --git a/src/components/common/Picker.tsx b/src/components/common/Picker.tsx index 91c304ddf..13c006c2b 100644 --- a/src/components/common/Picker.tsx +++ b/src/components/common/Picker.tsx @@ -2,7 +2,7 @@ import React, { FC, useCallback, useRef, useEffect, memo, } from '../../lib/teact/teact'; -import { isUserId } from '../../modules/helpers'; +import { isUserId } from '../../global/helpers'; import InfiniteScroll from '../ui/InfiniteScroll'; import Checkbox from '../ui/Checkbox'; diff --git a/src/components/common/PickerSelectedItem.tsx b/src/components/common/PickerSelectedItem.tsx index 0833b149d..b62d2cdce 100644 --- a/src/components/common/PickerSelectedItem.tsx +++ b/src/components/common/PickerSelectedItem.tsx @@ -1,10 +1,10 @@ import React, { FC, memo } from '../../lib/teact/teact'; -import { withGlobal } from '../../modules'; +import { withGlobal } from '../../global'; import { ApiChat, ApiUser } from '../../api/types'; -import { selectChat, selectUser } from '../../modules/selectors'; -import { getChatTitle, getUserFirstOrLastName, isUserId } from '../../modules/helpers'; +import { selectChat, selectUser } from '../../global/selectors'; +import { getChatTitle, getUserFirstOrLastName, isUserId } from '../../global/helpers'; import renderText from './helpers/renderText'; import buildClassName from '../../util/buildClassName'; import useLang from '../../hooks/useLang'; diff --git a/src/components/common/PinMessageModal.tsx b/src/components/common/PinMessageModal.tsx index 6c294656b..449b371da 100644 --- a/src/components/common/PinMessageModal.tsx +++ b/src/components/common/PinMessageModal.tsx @@ -1,7 +1,7 @@ import React, { FC, useCallback, memo } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; -import { selectChat, selectIsChatWithSelf, selectUser } from '../../modules/selectors'; +import { selectChat, selectIsChatWithSelf, selectUser } from '../../global/selectors'; import { isUserId, getUserFirstOrLastName, @@ -9,7 +9,7 @@ import { isChatBasicGroup, isChatSuperGroup, isChatChannel, -} from '../../modules/helpers'; +} from '../../global/helpers'; import useLang from '../../hooks/useLang'; import renderText from './helpers/renderText'; diff --git a/src/components/common/PrivateChatInfo.tsx b/src/components/common/PrivateChatInfo.tsx index 11cf57059..69b1dcab2 100644 --- a/src/components/common/PrivateChatInfo.tsx +++ b/src/components/common/PrivateChatInfo.tsx @@ -2,14 +2,14 @@ import { MouseEvent as ReactMouseEvent } from 'react'; import React, { FC, useEffect, useCallback, memo, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiUser, ApiTypingStatus, ApiUserStatus } from '../../api/types'; import { GlobalState } from '../../global/types'; import { MediaViewerOrigin } from '../../types'; -import { selectChatMessages, selectUser, selectUserStatus } from '../../modules/selectors'; -import { getUserFullName, getUserStatus, isUserOnline } from '../../modules/helpers'; +import { selectChatMessages, selectUser, selectUserStatus } from '../../global/selectors'; +import { getUserFullName, getUserStatus, isUserOnline } from '../../global/helpers'; import renderText from './helpers/renderText'; import useLang from '../../hooks/useLang'; diff --git a/src/components/common/ProfileInfo.tsx b/src/components/common/ProfileInfo.tsx index bf32ae154..669f45782 100644 --- a/src/components/common/ProfileInfo.tsx +++ b/src/components/common/ProfileInfo.tsx @@ -1,17 +1,17 @@ import React, { FC, useEffect, useCallback, memo, useState, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiUser, ApiChat, ApiUserStatus } from '../../api/types'; import { GlobalState } from '../../global/types'; import { MediaViewerOrigin } from '../../types'; import { IS_TOUCH_ENV } from '../../util/environment'; -import { selectChat, selectUser, selectUserStatus } from '../../modules/selectors'; +import { selectChat, selectUser, selectUserStatus } from '../../global/selectors'; import { getUserFullName, getUserStatus, isChatChannel, isUserOnline, -} from '../../modules/helpers'; +} from '../../global/helpers'; import renderText from './helpers/renderText'; import { captureEvents, SwipeDirection } from '../../util/captureEvents'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/common/ProfilePhoto.tsx b/src/components/common/ProfilePhoto.tsx index 1c6282466..3696dbd3a 100644 --- a/src/components/common/ProfilePhoto.tsx +++ b/src/components/common/ProfilePhoto.tsx @@ -12,7 +12,7 @@ import { isUserId, isChatWithRepliesBot, isDeletedUser, -} from '../../modules/helpers'; +} from '../../global/helpers'; import renderText from './helpers/renderText'; import buildClassName from '../../util/buildClassName'; import { getFirstLetters } from '../../util/textFormat'; diff --git a/src/components/common/ReactionStaticEmoji.tsx b/src/components/common/ReactionStaticEmoji.tsx index 3012acc7e..8a715e029 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 '../../modules'; +import { getGlobal } from '../../global'; import { ApiMediaFormat } from '../../api/types'; diff --git a/src/components/common/ReportMessageModal.tsx b/src/components/common/ReportMessageModal.tsx index 5ea8a0a9c..51a7ba4d1 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 { getActions } from '../../modules'; +import { getActions } from '../../global'; import { ApiReportReason } from '../../api/types'; diff --git a/src/components/common/SafeLink.tsx b/src/components/common/SafeLink.tsx index a1d32f305..2d7b4d0eb 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 { getActions } from '../../modules'; +import { getActions } from '../../global'; import convertPunycode from '../../lib/punycode'; import { diff --git a/src/components/common/SeenByModal.tsx b/src/components/common/SeenByModal.tsx index dfb71453c..3bc4a517e 100644 --- a/src/components/common/SeenByModal.tsx +++ b/src/components/common/SeenByModal.tsx @@ -1,8 +1,8 @@ import React, { FC, useCallback, memo } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import useLang from '../../hooks/useLang'; -import { selectChatMessage } from '../../modules/selectors'; +import { selectChatMessage } from '../../global/selectors'; import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; import Modal from '../ui/Modal'; diff --git a/src/components/common/StickerSetModal.tsx b/src/components/common/StickerSetModal.tsx index 5d58a50d1..b99297d81 100644 --- a/src/components/common/StickerSetModal.tsx +++ b/src/components/common/StickerSetModal.tsx @@ -1,18 +1,18 @@ import React, { FC, memo, useCallback, useEffect, useRef, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiSticker, ApiStickerSet } from '../../api/types'; import { STICKER_SIZE_MODAL } from '../../config'; import { selectChat, selectCurrentMessageList, selectStickerSet, selectStickerSetByShortName, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; import useLang from '../../hooks/useLang'; import renderText from './helpers/renderText'; -import { getAllowedAttachmentOptions, getCanPostInChat } from '../../modules/helpers'; +import { getAllowedAttachmentOptions, getCanPostInChat } from '../../global/helpers'; import Modal from '../ui/Modal'; import Button from '../ui/Button'; diff --git a/src/components/common/TypingStatus.tsx b/src/components/common/TypingStatus.tsx index 766db4df8..84244a1cc 100644 --- a/src/components/common/TypingStatus.tsx +++ b/src/components/common/TypingStatus.tsx @@ -1,10 +1,10 @@ import React, { FC, memo } from '../../lib/teact/teact'; -import { withGlobal } from '../../modules'; +import { withGlobal } from '../../global'; import { ApiUser, ApiTypingStatus } from '../../api/types'; -import { selectUser } from '../../modules/selectors'; -import { getUserFirstOrLastName } from '../../modules/helpers'; +import { selectUser } from '../../global/selectors'; +import { getUserFirstOrLastName } from '../../global/helpers'; import renderText from './helpers/renderText'; import useLang from '../../hooks/useLang'; diff --git a/src/components/common/UiLoader.tsx b/src/components/common/UiLoader.tsx index 71e0a0205..39fcbf508 100644 --- a/src/components/common/UiLoader.tsx +++ b/src/components/common/UiLoader.tsx @@ -1,10 +1,10 @@ import React, { FC, useEffect } from '../../lib/teact/teact'; -import { getActions, getGlobal, withGlobal } from '../../modules'; +import { getActions, getGlobal, withGlobal } from '../../global'; import { ApiMediaFormat } from '../../api/types'; import { GlobalState } from '../../global/types'; -import { getChatAvatarHash } from '../../modules/helpers/chats'; // Direct import for better module splitting +import { getChatAvatarHash } from '../../global/helpers/chats'; // Direct import for better module splitting import useFlag from '../../hooks/useFlag'; import useShowTransition from '../../hooks/useShowTransition'; import { pause } from '../../util/schedulers'; @@ -19,7 +19,7 @@ import './UiLoader.scss'; import telegramLogoPath from '../../assets/telegram-logo.svg'; import reactionThumbsPath from '../../assets/reaction-thumbs.png'; import monkeyPath from '../../assets/monkey.svg'; -import { selectIsRightColumnShown, selectTheme } from '../../modules/selectors'; +import { selectIsRightColumnShown, selectTheme } from '../../global/selectors'; type OwnProps = { page: 'main' | 'authCode' | 'authPassword' | 'authPhoneNumber' | 'authQrCode'; diff --git a/src/components/common/UserLink.tsx b/src/components/common/UserLink.tsx index 1ce2fe580..1ab380885 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 { getActions } from '../../modules'; +import { getActions } from '../../global'; type OwnProps = { className?: string; diff --git a/src/components/common/WebLink.tsx b/src/components/common/WebLink.tsx index 51cbb0812..2c5223533 100644 --- a/src/components/common/WebLink.tsx +++ b/src/components/common/WebLink.tsx @@ -6,7 +6,7 @@ import { ObserveFn } from '../../hooks/useIntersectionObserver'; import { getFirstLinkInMessage, getMessageText, getMessageWebPage, -} from '../../modules/helpers'; +} from '../../global/helpers'; import buildClassName from '../../util/buildClassName'; import trimText from '../../util/trimText'; import renderText from './helpers/renderText'; diff --git a/src/components/common/helpers/mediaDimensions.ts b/src/components/common/helpers/mediaDimensions.ts index 58743f8a3..30aa58cab 100644 --- a/src/components/common/helpers/mediaDimensions.ts +++ b/src/components/common/helpers/mediaDimensions.ts @@ -5,7 +5,7 @@ import { import { STICKER_SIZE_INLINE_DESKTOP_FACTOR, STICKER_SIZE_INLINE_MOBILE_FACTOR } from '../../../config'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment'; import windowSize from '../../../util/windowSize'; -import { getPhotoInlineDimensions, getVideoDimensions } from '../../../modules/helpers'; +import { getPhotoInlineDimensions, getVideoDimensions } from '../../../global/helpers'; export const MEDIA_VIEWER_MEDIA_QUERY = '(max-height: 640px)'; export const REM = parseInt(getComputedStyle(document.documentElement).fontSize, 10); diff --git a/src/components/common/helpers/renderActionMessageText.tsx b/src/components/common/helpers/renderActionMessageText.tsx index 16a2e5302..448b83019 100644 --- a/src/components/common/helpers/renderActionMessageText.tsx +++ b/src/components/common/helpers/renderActionMessageText.tsx @@ -8,7 +8,7 @@ import { getChatTitle, getMessageSummaryText, getUserFullName, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import trimText from '../../../util/trimText'; import { formatCurrency } from '../../../util/formatCurrency'; import { TextPart, renderMessageSummary } from './renderMessageText'; diff --git a/src/components/common/helpers/renderMessageText.ts b/src/components/common/helpers/renderMessageText.ts index 4c80366e2..e3433faf5 100644 --- a/src/components/common/helpers/renderMessageText.ts +++ b/src/components/common/helpers/renderMessageText.ts @@ -5,7 +5,7 @@ import { getMessageSummaryText, getMessageText, TRUNCATED_SUMMARY_LENGTH, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import { LangFn } from '../../../hooks/useLang'; import renderText from './renderText'; import { renderTextWithEntities, TextPart } from './renderTextWithEntities'; diff --git a/src/components/common/helpers/renderTextWithEntities.tsx b/src/components/common/helpers/renderTextWithEntities.tsx index d6ad0930c..eb0d8d3b5 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 { getActions } from '../../../modules'; +import { getActions } from '../../../global'; 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 33d0914a3..9fc128835 100644 --- a/src/components/common/hooks/useAnimatedEmoji.ts +++ b/src/components/common/hooks/useAnimatedEmoji.ts @@ -2,11 +2,11 @@ import { useCallback, useEffect, useRef, useState, } from '../../../lib/teact/teact'; import safePlay from '../../../util/safePlay'; -import { getActions } from '../../../modules'; +import { getActions } from '../../../global'; import useMedia from '../../../hooks/useMedia'; import { ActiveEmojiInteraction } from '../../../global/types'; import useFlag from '../../../hooks/useFlag'; -import { selectLocalAnimatedEmojiEffectByName } from '../../../modules/selectors'; +import { selectLocalAnimatedEmojiEffectByName } from '../../../global/selectors'; const WIDTH = { large: 160, diff --git a/src/components/left/ChatFolderModal.tsx b/src/components/left/ChatFolderModal.tsx index f03d3d0cc..aac30e45a 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChatFolder } from '../../api/types'; diff --git a/src/components/left/LeftColumn.tsx b/src/components/left/LeftColumn.tsx index 9cecf6d77..e7b344651 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { LeftColumnContent, SettingsScreens } from '../../types'; diff --git a/src/components/left/main/Chat.tsx b/src/components/left/main/Chat.tsx index fc98d552b..90de14565 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 { getActions, getGlobal, withGlobal } from '../../../modules'; +import { getActions, getGlobal, withGlobal } from '../../../global'; import useLang, { LangFn } from '../../../hooks/useLang'; @@ -25,11 +25,11 @@ import { getMessageSticker, selectIsChatMuted, getMessageRoundVideo, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import { selectChat, selectUser, selectChatMessage, selectOutgoingStatus, selectDraft, selectCurrentMessageList, selectNotifySettings, selectNotifyExceptions, selectUserStatus, -} from '../../../modules/selectors'; +} from '../../../global/selectors'; import { renderActionMessageText } from '../../common/helpers/renderActionMessageText'; import renderText from '../../common/helpers/renderText'; import { fastRaf } from '../../../util/schedulers'; diff --git a/src/components/left/main/ChatFolders.tsx b/src/components/left/main/ChatFolders.tsx index 72f57c26d..cf8c6a949 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; 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 b3d3095f8..9eca97bcd 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 { getActions } from '../../../modules'; +import { getActions } from '../../../global'; 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 cc547d84c..8043df7f3 100644 --- a/src/components/left/main/ContactList.tsx +++ b/src/components/left/main/ContactList.tsx @@ -1,13 +1,13 @@ import React, { FC, useEffect, useCallback, useMemo, memo, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiUser, ApiUserStatus } from '../../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; import { throttle } from '../../../util/schedulers'; -import { filterUsersByName, sortUserIds } from '../../../modules/helpers'; +import { filterUsersByName, sortUserIds } from '../../../global/helpers'; import useInfiniteScroll from '../../../hooks/useInfiniteScroll'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/left/main/EmptyFolder.tsx b/src/components/left/main/EmptyFolder.tsx index 19849a916..9dbf9bf14 100644 --- a/src/components/left/main/EmptyFolder.tsx +++ b/src/components/left/main/EmptyFolder.tsx @@ -1,12 +1,12 @@ import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../modules'; +import { withGlobal } from '../../../global'; import { ApiChatFolder, ApiSticker } from '../../../api/types'; import { SettingsScreens } from '../../../types'; import { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; -import { selectAnimatedEmoji, selectChatFolder } from '../../../modules/selectors'; +import { selectAnimatedEmoji, selectChatFolder } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; import Button from '../../ui/Button'; diff --git a/src/components/left/main/LeftMainHeader.tsx b/src/components/left/main/LeftMainHeader.tsx index 1fed75f2e..81e45294b 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ISettings, LeftColumnContent } from '../../../types'; import { ApiChat } from '../../../api/types'; @@ -16,8 +16,8 @@ import { formatDateToString } from '../../../util/dateFormat'; import switchTheme from '../../../util/switchTheme'; import { setPermanentWebVersion } from '../../../util/permanentWebVersion'; import { clearWebsync } from '../../../util/websync'; -import { selectCurrentMessageList, selectTheme } from '../../../modules/selectors'; -import { isChatArchived } from '../../../modules/helpers'; +import { selectCurrentMessageList, selectTheme } from '../../../global/selectors'; +import { isChatArchived } from '../../../global/helpers'; import useLang from '../../../hooks/useLang'; import { disableHistoryBack } from '../../../hooks/useHistoryBack'; import useConnectionStatus from '../../../hooks/useConnectionStatus'; diff --git a/src/components/left/newChat/NewChatStep1.tsx b/src/components/left/newChat/NewChatStep1.tsx index 079d70b0e..ccf43b356 100644 --- a/src/components/left/newChat/NewChatStep1.tsx +++ b/src/components/left/newChat/NewChatStep1.tsx @@ -1,13 +1,13 @@ import React, { FC, useCallback, useEffect, useMemo, memo, } from '../../../lib/teact/teact'; -import { getActions, getGlobal, withGlobal } from '../../../modules'; +import { getActions, getGlobal, withGlobal } from '../../../global'; import { ApiChat } from '../../../api/types'; import { unique } from '../../../util/iteratees'; import { throttle } from '../../../util/schedulers'; -import { filterUsersByName, isUserBot, sortChatIds } from '../../../modules/helpers'; +import { filterUsersByName, isUserBot, sortChatIds } from '../../../global/helpers'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/left/newChat/NewChatStep2.tsx b/src/components/left/newChat/NewChatStep2.tsx index 64b7ad2ab..3ca88a184 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ChatCreationProgress } from '../../../types'; diff --git a/src/components/left/search/AudioResults.tsx b/src/components/left/search/AudioResults.tsx index 7806f7502..5332d0bbd 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { AudioOrigin, LoadMoreDirection } from '../../../types'; diff --git a/src/components/left/search/ChatMessage.tsx b/src/components/left/search/ChatMessage.tsx index 5c84cefba..477a9cd32 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, @@ -15,8 +15,8 @@ import { getMessageMediaThumbDataUri, getMessageVideo, getMessageRoundVideo, -} from '../../../modules/helpers'; -import { selectChat, selectUser } from '../../../modules/selectors'; +} from '../../../global/helpers'; +import { selectChat, selectUser } from '../../../global/selectors'; import renderText from '../../common/helpers/renderText'; import useMedia from '../../../hooks/useMedia'; import { formatPastTimeShort } from '../../../util/dateFormat'; diff --git a/src/components/left/search/ChatMessageResults.tsx b/src/components/left/search/ChatMessageResults.tsx index 69f48784e..68cb6d718 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; 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 1103c583c..c226ec004 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 { getActions, getGlobal, withGlobal } from '../../../modules'; +import { getActions, getGlobal, withGlobal } from '../../../global'; import { ApiChat, ApiMessage } from '../../../api/types'; import { LoadMoreDirection } from '../../../types'; @@ -11,7 +11,7 @@ import { unique } from '../../../util/iteratees'; import { sortChatIds, filterUsersByName, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; import { throttle } from '../../../util/schedulers'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/left/search/FileResults.tsx b/src/components/left/search/FileResults.tsx index 390c08649..3fff46a13 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiMessage } from '../../../api/types'; import { LoadMoreDirection } from '../../../types'; @@ -12,7 +12,7 @@ import { createMapStateToProps, StateProps } from './helpers/createMapStateToPro import { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat'; import { getSenderName } from './helpers/getSenderName'; import { throttle } from '../../../util/schedulers'; -import { getMessageDocument } from '../../../modules/helpers'; +import { getMessageDocument } from '../../../global/helpers'; import useAsyncRendering from '../../right/hooks/useAsyncRendering'; import useLang from '../../../hooks/useLang'; import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver'; diff --git a/src/components/left/search/LeftSearch.tsx b/src/components/left/search/LeftSearch.tsx index 2096205b7..fb87ae16a 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { GlobalSearchContent } from '../../../types'; diff --git a/src/components/left/search/LeftSearchResultChat.tsx b/src/components/left/search/LeftSearchResultChat.tsx index c966aaf42..60cd6172c 100644 --- a/src/components/left/search/LeftSearchResultChat.tsx +++ b/src/components/left/search/LeftSearchResultChat.tsx @@ -1,16 +1,16 @@ import React, { FC, memo, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../modules'; +import { withGlobal } from '../../../global'; import { ApiChat, ApiUser } from '../../../api/types'; import useChatContextActions from '../../../hooks/useChatContextActions'; import useFlag from '../../../hooks/useFlag'; -import { isUserId, getPrivateChatUserId, selectIsChatMuted } from '../../../modules/helpers'; +import { isUserId, getPrivateChatUserId, selectIsChatMuted } from '../../../global/helpers'; import { selectChat, selectUser, selectIsChatPinned, selectNotifySettings, selectNotifyExceptions, -} from '../../../modules/selectors'; +} from '../../../global/selectors'; import useSelectWithEnter from '../../../hooks/useSelectWithEnter'; import PrivateChatInfo from '../../common/PrivateChatInfo'; diff --git a/src/components/left/search/LinkResults.tsx b/src/components/left/search/LinkResults.tsx index db72fae0a..7216ac0be 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { LoadMoreDirection } from '../../../types'; diff --git a/src/components/left/search/MediaResults.tsx b/src/components/left/search/MediaResults.tsx index 64b1e2606..0d88165e2 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { LoadMoreDirection, MediaViewerOrigin } from '../../../types'; diff --git a/src/components/left/search/RecentContacts.tsx b/src/components/left/search/RecentContacts.tsx index d98c8b527..2fda1dff4 100644 --- a/src/components/left/search/RecentContacts.tsx +++ b/src/components/left/search/RecentContacts.tsx @@ -1,11 +1,11 @@ import React, { FC, useEffect, useCallback, useRef, memo, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiUser } from '../../../api/types'; -import { getUserFirstOrLastName } from '../../../modules/helpers'; +import { getUserFirstOrLastName } from '../../../global/helpers'; import renderText from '../../common/helpers/renderText'; import { throttle } from '../../../util/schedulers'; import useHorizontalScroll from '../../../hooks/useHorizontalScroll'; diff --git a/src/components/left/search/helpers/createMapStateToProps.ts b/src/components/left/search/helpers/createMapStateToProps.ts index 5c28a6c65..e59e2bfa2 100644 --- a/src/components/left/search/helpers/createMapStateToProps.ts +++ b/src/components/left/search/helpers/createMapStateToProps.ts @@ -4,7 +4,7 @@ import { } from '../../../../api/types'; import { ISettings } from '../../../../types'; -import { selectChat, selectTheme } from '../../../../modules/selectors'; +import { selectChat, selectTheme } from '../../../../global/selectors'; export type StateProps = { theme: ISettings['theme']; diff --git a/src/components/left/search/helpers/getSenderName.ts b/src/components/left/search/helpers/getSenderName.ts index 6b3f766e2..ca01dc0e0 100644 --- a/src/components/left/search/helpers/getSenderName.ts +++ b/src/components/left/search/helpers/getSenderName.ts @@ -4,7 +4,7 @@ import { getSenderTitle, isUserId, isChatGroup, -} from '../../../../modules/helpers'; +} from '../../../../global/helpers'; import { LangFn } from '../../../../hooks/useLang'; export function getSenderName( diff --git a/src/components/left/settings/BlockUserModal.tsx b/src/components/left/settings/BlockUserModal.tsx index 56661e993..1df84603c 100644 --- a/src/components/left/settings/BlockUserModal.tsx +++ b/src/components/left/settings/BlockUserModal.tsx @@ -1,11 +1,11 @@ import React, { FC, useMemo, useState, memo, useRef, useCallback, useEffect, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiUser } from '../../../api/types'; -import { filterUsersByName, getUserFullName } from '../../../modules/helpers'; +import { filterUsersByName, getUserFullName } from '../../../global/helpers'; import { unique } from '../../../util/iteratees'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/left/settings/SettingsDataStorage.tsx b/src/components/left/settings/SettingsDataStorage.tsx index 88dd4b413..54883dbfd 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { SettingsScreens, ISettings } from '../../../types'; diff --git a/src/components/left/settings/SettingsEditProfile.tsx b/src/components/left/settings/SettingsEditProfile.tsx index b5a341f3b..27b9a4189 100644 --- a/src/components/left/settings/SettingsEditProfile.tsx +++ b/src/components/left/settings/SettingsEditProfile.tsx @@ -2,14 +2,14 @@ import { ChangeEvent } from 'react'; import React, { FC, useState, useCallback, memo, useEffect, useMemo, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiMediaFormat } from '../../../api/types'; import { ProfileEditProgress, SettingsScreens } from '../../../types'; import { throttle } from '../../../util/schedulers'; -import { selectUser } from '../../../modules/selectors'; -import { getChatAvatarHash } from '../../../modules/helpers'; +import { selectUser } from '../../../global/selectors'; +import { getChatAvatarHash } from '../../../global/helpers'; import useMedia from '../../../hooks/useMedia'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/left/settings/SettingsGeneral.tsx b/src/components/left/settings/SettingsGeneral.tsx index cf369cff9..804efb6fa 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; 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 1172aace4..2df6d5fc1 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { SettingsScreens, ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types'; import { ApiWallpaper } from '../../../api/types'; @@ -10,7 +10,7 @@ import { DARK_THEME_PATTERN_COLOR, DEFAULT_PATTERN_COLOR } from '../../../config import { throttle } from '../../../util/schedulers'; import { openSystemFilesDialog } from '../../../util/systemFilesDialog'; import { getAverageColor, getPatternColor, rgb2hex } from '../../../util/colors'; -import { selectTheme } from '../../../modules/selectors'; +import { selectTheme } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/SettingsGeneralBackgroundColor.tsx b/src/components/left/settings/SettingsGeneralBackgroundColor.tsx index 6b8afcae5..43a3104d7 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { SettingsScreens, ThemeKey } from '../../../types'; @@ -11,7 +11,7 @@ import { getPatternColor, hex2rgb, hsb2rgb, rgb2hex, rgb2hsb, } from '../../../util/colors'; import { captureEvents, RealTouchEvent } from '../../../util/captureEvents'; -import { selectTheme } from '../../../modules/selectors'; +import { selectTheme } from '../../../global/selectors'; import useFlag from '../../../hooks/useFlag'; import buildClassName from '../../../util/buildClassName'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/SettingsHeader.tsx b/src/components/left/settings/SettingsHeader.tsx index 25872b678..d0162d6b9 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 { getActions } from '../../../modules'; +import { getActions } from '../../../global'; import { SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsLanguage.tsx b/src/components/left/settings/SettingsLanguage.tsx index 14d7a4e89..0c5742fbc 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; 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 67a196c42..8bca6c762 100644 --- a/src/components/left/settings/SettingsMain.tsx +++ b/src/components/left/settings/SettingsMain.tsx @@ -1,10 +1,10 @@ import React, { FC, memo, useEffect } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { SettingsScreens } from '../../../types'; import { ApiUser } from '../../../api/types'; -import { selectUser } from '../../../modules/selectors'; +import { selectUser } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/SettingsNotifications.tsx b/src/components/left/settings/SettingsNotifications.tsx index d0d366039..880b18055 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsPrivacy.tsx b/src/components/left/settings/SettingsPrivacy.tsx index 13e8a2da0..07dc10d49 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { PrivacyVisibility, SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsPrivacyActiveSessions.tsx b/src/components/left/settings/SettingsPrivacyActiveSessions.tsx index cb8163c60..214dba622 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; 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 56b8075e5..4f76974b4 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat, ApiCountryCode, ApiUser } from '../../../api/types'; import { SettingsScreens } from '../../../types'; @@ -10,7 +10,7 @@ import { CHAT_HEIGHT_PX } from '../../../config'; import { formatPhoneNumberWithCode } from '../../../util/phoneNumber'; import { getChatTitle, getUserFullName, isUserId, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import renderText from '../../common/helpers/renderText'; import buildClassName from '../../../util/buildClassName'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/left/settings/SettingsPrivacyVisibility.tsx b/src/components/left/settings/SettingsPrivacyVisibility.tsx index 59551ef50..90a5f73b8 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; 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 4dfba4dd6..154aaca5e 100644 --- a/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx +++ b/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx @@ -1,14 +1,14 @@ import React, { FC, memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; -import { getActions, getGlobal, withGlobal } from '../../../modules'; +import { getActions, getGlobal, withGlobal } from '../../../global'; import { GlobalState } from '../../../global/types'; import { ApiPrivacySettings, SettingsScreens } from '../../../types'; import { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID } from '../../../config'; import { unique } from '../../../util/iteratees'; -import { filterChatsByName, isChatGroup, isUserId } from '../../../modules/helpers'; +import { filterChatsByName, isChatGroup, isUserId } from '../../../global/helpers'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; import { useFolderManagerForOrderedIds } from '../../../hooks/useFolderManager'; diff --git a/src/components/left/settings/SettingsQuickReaction.tsx b/src/components/left/settings/SettingsQuickReaction.tsx index 032ac541a..472003599 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; 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 cede391db..4e80530e3 100644 --- a/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx +++ b/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx @@ -1,14 +1,14 @@ import React, { FC, memo, useMemo, useCallback, } from '../../../../lib/teact/teact'; -import { getGlobal } from '../../../../modules'; +import { getGlobal } from '../../../../global'; import { SettingsScreens } from '../../../../types'; import { unique } from '../../../../util/iteratees'; import { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID } from '../../../../config'; -import { filterChatsByName } from '../../../../modules/helpers'; +import { filterChatsByName } from '../../../../global/helpers'; import useLang from '../../../../hooks/useLang'; import useHistoryBack from '../../../../hooks/useHistoryBack'; import { useFolderManagerForOrderedIds } from '../../../../hooks/useFolderManager'; diff --git a/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx b/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx index 4f11ed177..19208d25b 100644 --- a/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx +++ b/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx @@ -2,7 +2,7 @@ import React, { FC, useCallback, useRef, useEffect, memo, } from '../../../../lib/teact/teact'; -import { isUserId } from '../../../../modules/helpers'; +import { isUserId } from '../../../../global/helpers'; import { INCLUDED_CHAT_TYPES, EXCLUDED_CHAT_TYPES, diff --git a/src/components/left/settings/folders/SettingsFoldersEdit.tsx b/src/components/left/settings/folders/SettingsFoldersEdit.tsx index 5013dbd42..e12e11cb9 100644 --- a/src/components/left/settings/folders/SettingsFoldersEdit.tsx +++ b/src/components/left/settings/folders/SettingsFoldersEdit.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../../modules'; +import { getActions, withGlobal } from '../../../../global'; import { SettingsScreens } from '../../../../types'; import { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config'; import { findIntersectionWithSet } from '../../../../util/iteratees'; -import { isUserId } from '../../../../modules/helpers'; +import { isUserId } from '../../../../global/helpers'; import getAnimationData from '../../../common/helpers/animatedAssets'; import { EXCLUDED_CHAT_TYPES, diff --git a/src/components/left/settings/folders/SettingsFoldersMain.tsx b/src/components/left/settings/folders/SettingsFoldersMain.tsx index 5bf4b7dcf..4cc3fcd00 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 { getActions, withGlobal } from '../../../../modules'; +import { getActions, withGlobal } from '../../../../global'; import { ApiChatFolder } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; @@ -9,7 +9,7 @@ import { SettingsScreens } from '../../../../types'; import { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config'; import { throttle } from '../../../../util/schedulers'; import getAnimationData from '../../../common/helpers/animatedAssets'; -import { getFolderDescriptionText } from '../../../../modules/helpers'; +import { getFolderDescriptionText } from '../../../../global/helpers'; import useLang from '../../../../hooks/useLang'; import useHistoryBack from '../../../../hooks/useHistoryBack'; import { useFolderManagerForChatsCount } from '../../../../hooks/useFolderManager'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFa.tsx b/src/components/left/settings/twoFa/SettingsTwoFa.tsx index b654f552c..e0e7e872b 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 { getActions, withGlobal } from '../../../../modules'; +import { getActions, withGlobal } from '../../../../global'; 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 367365c2a..854c58639 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx @@ -1,10 +1,10 @@ import React, { FC, memo } from '../../../../lib/teact/teact'; -import { withGlobal } from '../../../../modules'; +import { withGlobal } from '../../../../global'; import { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; -import { selectAnimatedEmoji } from '../../../../modules/selectors'; +import { selectAnimatedEmoji } from '../../../../global/selectors'; import useLang from '../../../../hooks/useLang'; import useHistoryBack from '../../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx b/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx index 34584edc2..b1f269a3a 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useEffect, useRef, useState, } from '../../../../lib/teact/teact'; -import { withGlobal } from '../../../../modules'; +import { withGlobal } from '../../../../global'; import { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment'; -import { selectAnimatedEmoji } from '../../../../modules/selectors'; +import { selectAnimatedEmoji } from '../../../../global/selectors'; import useLang from '../../../../hooks/useLang'; import useHistoryBack from '../../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx b/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx index 6b49a80cd..402358314 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx @@ -1,10 +1,10 @@ import React, { FC, memo } from '../../../../lib/teact/teact'; -import { withGlobal } from '../../../../modules'; +import { withGlobal } from '../../../../global'; import { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; -import { selectAnimatedEmoji } from '../../../../modules/selectors'; +import { selectAnimatedEmoji } from '../../../../global/selectors'; import useLang from '../../../../hooks/useLang'; import useHistoryBack from '../../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx b/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx index 281166fb8..b8af8c88d 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useEffect, useRef, useState, } from '../../../../lib/teact/teact'; -import { withGlobal } from '../../../../modules'; +import { withGlobal } from '../../../../global'; import { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment'; -import { selectAnimatedEmoji } from '../../../../modules/selectors'; +import { selectAnimatedEmoji } from '../../../../global/selectors'; import useFlag from '../../../../hooks/useFlag'; import useLang from '../../../../hooks/useLang'; import useHistoryBack from '../../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx b/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx index 0da8c6e7c..7ffe8f1a1 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx @@ -1,10 +1,10 @@ import React, { FC, memo } from '../../../../lib/teact/teact'; -import { withGlobal } from '../../../../modules'; +import { withGlobal } from '../../../../global'; import { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; -import { selectAnimatedEmoji } from '../../../../modules/selectors'; +import { selectAnimatedEmoji } from '../../../../global/selectors'; import useLang from '../../../../hooks/useLang'; import useHistoryBack from '../../../../hooks/useHistoryBack'; diff --git a/src/components/main/Dialogs.tsx b/src/components/main/Dialogs.tsx index 148d91ce3..7b2a3b382 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiContact, ApiError, ApiInviteInfo, ApiPhoto, diff --git a/src/components/main/DownloadManager.tsx b/src/components/main/DownloadManager.tsx index f8ebb848b..6db293cb0 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { Thread } from '../../global/types'; import { ApiMediaFormat, ApiMessage } from '../../api/types'; @@ -8,7 +8,7 @@ import * as mediaLoader from '../../util/mediaLoader'; import download from '../../util/download'; import { getMessageContentFilename, getMessageMediaHash, -} from '../../modules/helpers'; +} from '../../global/helpers'; type StateProps = { activeDownloads: Record; diff --git a/src/components/main/ForwardPicker.tsx b/src/components/main/ForwardPicker.tsx index e175374d7..11c205f24 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 { getActions, getGlobal, withGlobal } from '../../modules'; +import { getActions, getGlobal, withGlobal } from '../../global'; import { ApiChat, MAIN_THREAD_ID } from '../../api/types'; @@ -10,7 +10,7 @@ import { filterUsersByName, getCanPostInChat, sortChatIds, -} from '../../modules/helpers'; +} from '../../global/helpers'; import { unique } from '../../util/iteratees'; import useLang from '../../hooks/useLang'; import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; diff --git a/src/components/main/HistoryCalendar.tsx b/src/components/main/HistoryCalendar.tsx index 38bc088e3..161fa5477 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import useLang from '../../hooks/useLang'; diff --git a/src/components/main/Main.tsx b/src/components/main/Main.tsx index 17ba7925f..e06755a47 100644 --- a/src/components/main/Main.tsx +++ b/src/components/main/Main.tsx @@ -1,12 +1,12 @@ import React, { FC, useEffect, memo, useCallback, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { LangCode } from '../../types'; import { ApiMessage, ApiUpdateAuthorizationStateType, ApiUpdateConnectionStateType } from '../../api/types'; -import '../../modules/actions/all'; +import '../../global/actions/all'; import { BASE_EMOJI_KEYWORD_LANG, DEBUG, INACTIVE_MARKER, PAGE_TITLE, } from '../../config'; @@ -16,7 +16,7 @@ import { selectIsMediaViewerOpen, selectIsRightColumnShown, selectIsServiceChatReady, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck'; import buildClassName from '../../util/buildClassName'; import { fastRaf } from '../../util/schedulers'; diff --git a/src/components/main/Notifications.tsx b/src/components/main/Notifications.tsx index 9f22972de..706ead00b 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiNotification } from '../../api/types'; diff --git a/src/components/main/SafeLinkModal.tsx b/src/components/main/SafeLinkModal.tsx index 07476650c..01e4b1ee0 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 { getActions } from '../../modules'; +import { getActions } from '../../global'; 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 43c701404..24d6bbaf9 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser, @@ -34,7 +34,7 @@ import { getVideoDimensions, isMessageDocumentPhoto, isMessageDocumentVideo, -} from '../../modules/helpers'; +} from '../../global/helpers'; import { selectChat, selectChatMessage, @@ -45,7 +45,7 @@ import { selectScheduledMessage, selectScheduledMessages, selectUser, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { stopCurrentAudio } from '../../util/audioPlayer'; import captureEscKeyListener from '../../util/captureEscKeyListener'; import { captureEvents } from '../../util/captureEvents'; diff --git a/src/components/mediaViewer/MediaViewerActions.tsx b/src/components/mediaViewer/MediaViewerActions.tsx index 5f5809be7..d7b76cdd4 100644 --- a/src/components/mediaViewer/MediaViewerActions.tsx +++ b/src/components/mediaViewer/MediaViewerActions.tsx @@ -4,15 +4,15 @@ import React, { useCallback, useMemo, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiMessage } from '../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; -import { getMessageMediaHash } from '../../modules/helpers'; +import { getMessageMediaHash } from '../../global/helpers'; import useLang from '../../hooks/useLang'; import useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress'; -import { selectIsDownloading, selectIsMessageProtected } from '../../modules/selectors'; +import { selectIsDownloading, selectIsMessageProtected } from '../../global/selectors'; import Button from '../ui/Button'; import DropdownMenu from '../ui/DropdownMenu'; diff --git a/src/components/mediaViewer/MediaViewerContent.tsx b/src/components/mediaViewer/MediaViewerContent.tsx index dc865f598..04726d3f2 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 '../../modules'; +import { withGlobal } from '../../global'; import { ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser, @@ -25,10 +25,10 @@ import { getVideoDimensions, isMessageDocumentPhoto, isMessageDocumentVideo, -} from '../../modules/helpers'; +} from '../../global/helpers'; import { selectChat, selectChatMessage, selectIsMessageProtected, selectScheduledMessage, selectUser, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { AVATAR_FULL_DIMENSIONS, calculateMediaViewerDimensions } from '../common/helpers/mediaDimensions'; import { renderMessageText } from '../common/helpers/renderMessageText'; import stopEvent from '../../util/stopEvent'; diff --git a/src/components/mediaViewer/SenderInfo.tsx b/src/components/mediaViewer/SenderInfo.tsx index 0dd71f16e..dc70b0315 100644 --- a/src/components/mediaViewer/SenderInfo.tsx +++ b/src/components/mediaViewer/SenderInfo.tsx @@ -1,10 +1,10 @@ import React, { FC, useCallback } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChat, ApiMessage, ApiUser } from '../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; -import { getSenderTitle, isUserId } from '../../modules/helpers'; +import { getSenderTitle, isUserId } from '../../global/helpers'; import { formatMediaDateTime } from '../../util/dateFormat'; import renderText from '../common/helpers/renderText'; import { @@ -12,7 +12,7 @@ import { selectChatMessage, selectSender, selectUser, -} from '../../modules/selectors'; +} from '../../global/selectors'; import useLang from '../../hooks/useLang'; import Avatar from '../common/Avatar'; diff --git a/src/components/mediaViewer/helpers/ghostAnimation.ts b/src/components/mediaViewer/helpers/ghostAnimation.ts index 3d3ed2271..b3eedf819 100644 --- a/src/components/mediaViewer/helpers/ghostAnimation.ts +++ b/src/components/mediaViewer/helpers/ghostAnimation.ts @@ -12,7 +12,7 @@ import { import windowSize from '../../../util/windowSize'; import stopEvent from '../../../util/stopEvent'; import { IS_TOUCH_ENV } from '../../../util/environment'; -import { getMessageHtmlId } from '../../../modules/helpers'; +import { getMessageHtmlId } from '../../../global/helpers'; const ANIMATION_DURATION = 200; diff --git a/src/components/middle/ActionMessage.tsx b/src/components/middle/ActionMessage.tsx index b5cfb7546..6e0fd2008 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 '../../modules'; +import { withGlobal } from '../../global'; import { ApiUser, ApiMessage, ApiChat } from '../../api/types'; import { FocusDirection } from '../../types'; @@ -11,8 +11,8 @@ import { selectChatMessage, selectIsMessageFocused, selectChat, -} from '../../modules/selectors'; -import { getMessageHtmlId, isChatChannel } from '../../modules/helpers'; +} from '../../global/selectors'; +import { getMessageHtmlId, isChatChannel } from '../../global/helpers'; import buildClassName from '../../util/buildClassName'; import { renderActionMessageText } from '../common/helpers/renderActionMessageText'; import useEnsureMessage from '../../hooks/useEnsureMessage'; diff --git a/src/components/middle/AudioPlayer.tsx b/src/components/middle/AudioPlayer.tsx index 8f3ce4418..3631b3e41 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { AudioOrigin } from '../../types'; import { @@ -13,8 +13,8 @@ import { IS_IOS, IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/enviro import * as mediaLoader from '../../util/mediaLoader'; import { getMediaDuration, getMessageContent, getMessageMediaHash, getSenderTitle, isMessageLocal, -} from '../../modules/helpers'; -import { selectChat, selectSender } from '../../modules/selectors'; +} from '../../global/helpers'; +import { selectChat, selectSender } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; import { makeTrackId } from '../../util/audioPlayer'; import { clearMediaSession } from '../../util/mediaSession'; diff --git a/src/components/middle/ContactGreeting.tsx b/src/components/middle/ContactGreeting.tsx index ed0c5c572..d1b2cb28e 100644 --- a/src/components/middle/ContactGreeting.tsx +++ b/src/components/middle/ContactGreeting.tsx @@ -1,14 +1,14 @@ import React, { FC, memo, useCallback, useEffect, useRef, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types'; -import { selectChat } from '../../modules/selectors'; +import { selectChat } from '../../global/selectors'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; import useLang from '../../hooks/useLang'; -import { getUserIdDividend } from '../../modules/helpers'; +import { getUserIdDividend } from '../../global/helpers'; import StickerButton from '../common/StickerButton'; diff --git a/src/components/middle/DeleteSelectedMessageModal.tsx b/src/components/middle/DeleteSelectedMessageModal.tsx index d54524009..e01670e8d 100644 --- a/src/components/middle/DeleteSelectedMessageModal.tsx +++ b/src/components/middle/DeleteSelectedMessageModal.tsx @@ -1,16 +1,16 @@ import React, { FC, useCallback, memo, useEffect, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; -import { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../modules/selectors'; +import { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../global/selectors'; import { isUserId, getUserFirstOrLastName, getPrivateChatUserId, isChatBasicGroup, isChatSuperGroup, -} from '../../modules/helpers'; +} from '../../global/helpers'; import renderText from '../common/helpers/renderText'; import useLang from '../../hooks/useLang'; import usePrevious from '../../hooks/usePrevious'; diff --git a/src/components/middle/EmojiInteractionAnimation.tsx b/src/components/middle/EmojiInteractionAnimation.tsx index 5db5fdbc9..3f6eb36d9 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ActiveEmojiInteraction } from '../../global/types'; import { ApiMediaFormat } from '../../api/types'; @@ -12,7 +12,7 @@ import useMedia from '../../hooks/useMedia'; import buildClassName from '../../util/buildClassName'; import { selectAnimatedEmojiEffect, -} from '../../modules/selectors'; +} from '../../global/selectors'; import getAnimationData, { ANIMATED_STICKERS_PATHS } from '../common/helpers/animatedAssets'; import { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck'; diff --git a/src/components/middle/HeaderActions.tsx b/src/components/middle/HeaderActions.tsx index 4b198f221..d0ad9ec3f 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { MessageListType } from '../../global/types'; import { MAIN_THREAD_ID } from '../../api/types'; @@ -18,7 +18,7 @@ import { import getKeyFromEvent from '../../util/getKeyFromEvent'; import { isChatBasicGroup, isChatChannel, isChatSuperGroup, isUserId, -} from '../../modules/helpers'; +} from '../../global/helpers'; import { selectChat, selectChatBot, @@ -27,7 +27,7 @@ import { selectIsChatWithSelf, selectIsInSelectMode, selectIsRightColumnShown, -} from '../../modules/selectors'; +} from '../../global/selectors'; import useLang from '../../hooks/useLang'; import Button from '../ui/Button'; diff --git a/src/components/middle/HeaderMenuContainer.tsx b/src/components/middle/HeaderMenuContainer.tsx index ea17bc88c..6af9093d0 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChat } from '../../api/types'; import { IAnchorPosition } from '../../types'; @@ -10,10 +10,10 @@ import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; import { disableScrolling, enableScrolling } from '../../util/scrollLock'; import { selectChat, selectNotifySettings, selectNotifyExceptions, selectUser, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { isUserId, getCanDeleteChat, selectIsChatMuted, getCanAddContact, -} from '../../modules/helpers'; +} from '../../global/helpers'; import useShowTransition from '../../hooks/useShowTransition'; import useLang from '../../hooks/useLang'; diff --git a/src/components/middle/HeaderPinnedMessage.tsx b/src/components/middle/HeaderPinnedMessage.tsx index c04cc477d..298e86cb9 100644 --- a/src/components/middle/HeaderPinnedMessage.tsx +++ b/src/components/middle/HeaderPinnedMessage.tsx @@ -3,7 +3,7 @@ import React, { FC, memo, useCallback } from '../../lib/teact/teact'; import { ApiMessage } from '../../api/types'; import { getPictogramDimensions } from '../common/helpers/mediaDimensions'; -import { getMessageMediaHash } from '../../modules/helpers'; +import { getMessageMediaHash } from '../../global/helpers'; import useMedia from '../../hooks/useMedia'; import useWebpThumbnail from '../../hooks/useWebpThumbnail'; diff --git a/src/components/middle/MessageList.tsx b/src/components/middle/MessageList.tsx index 1f36d71c9..ea593864c 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 { getActions, getGlobal, withGlobal } from '../../modules'; +import { getActions, getGlobal, withGlobal } from '../../global'; import { ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID, @@ -25,13 +25,13 @@ import { selectFirstMessageId, selectScheduledMessages, selectCurrentMessageIds, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { isChatChannel, isUserId, isChatWithRepliesBot, isChatGroup, -} from '../../modules/helpers'; +} from '../../global/helpers'; import { orderBy } from '../../util/iteratees'; import { fastRaf, debounce, onTickEnd } from '../../util/schedulers'; import useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps'; diff --git a/src/components/middle/MessageListContent.tsx b/src/components/middle/MessageListContent.tsx index c225d4821..958dda9f1 100644 --- a/src/components/middle/MessageListContent.tsx +++ b/src/components/middle/MessageListContent.tsx @@ -9,7 +9,7 @@ import { compact, flatten } from '../../util/iteratees'; import { formatHumanDate } from '../../util/dateFormat'; import { getMessageHtmlId, getMessageOriginalId, isActionMessage, isOwnMessage, -} from '../../modules/helpers'; +} from '../../global/helpers'; import useLang from '../../hooks/useLang'; import { isAlbum, MessageDateGroup } from './helpers/groupMessages'; import { preventMessageInputBlur } from './helpers/preventMessageInputBlur'; @@ -19,7 +19,7 @@ import useMessageObservers from './hooks/useMessageObservers'; import Message from './message/Message'; import SponsoredMessage from './message/SponsoredMessage'; import ActionMessage from './ActionMessage'; -import { getActions } from '../../modules'; +import { getActions } from '../../global'; interface OwnProps { chatId: string; diff --git a/src/components/middle/MessageSelectToolbar.tsx b/src/components/middle/MessageSelectToolbar.tsx index 455323e41..2d087d681 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { MessageListType } from '../../global/types'; @@ -12,7 +12,7 @@ import { selectCurrentMessageList, selectHasProtectedMessage, selectSelectedMessagesCount, -} from '../../modules/selectors'; +} from '../../global/selectors'; import useFlag from '../../hooks/useFlag'; import captureKeyboardListeners from '../../util/captureKeyboardListeners'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/middle/MiddleColumn.tsx b/src/components/middle/MiddleColumn.tsx index b2966cc11..079773bb8 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types'; import { @@ -43,10 +43,10 @@ import { selectPinnedIds, selectTheme, selectUser, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { getCanPostInChat, getMessageSendingRestrictionReason, isChatChannel, isChatSuperGroup, isUserId, -} from '../../modules/helpers'; +} from '../../global/helpers'; import captureEscKeyListener from '../../util/captureEscKeyListener'; import buildClassName from '../../util/buildClassName'; import { createMessageHash } from '../../util/routing'; diff --git a/src/components/middle/MiddleHeader.tsx b/src/components/middle/MiddleHeader.tsx index 5d25af836..2ad433379 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import cycleRestrict from '../../util/cycleRestrict'; import { GlobalState, MessageListType } from '../../global/types'; @@ -20,7 +20,7 @@ import { import { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../util/environment'; import { getChatTitle, getMessageKey, getPrivateChatUserId, getSenderTitle, isUserId, -} from '../../modules/helpers'; +} from '../../global/helpers'; import { selectAllowedMessageActions, selectChat, @@ -36,7 +36,7 @@ import { selectThreadInfo, selectThreadTopMessageId, selectUser, -} from '../../modules/selectors'; +} from '../../global/selectors'; import useEnsureMessage from '../../hooks/useEnsureMessage'; import useWindowSize from '../../hooks/useWindowSize'; import useShowTransition from '../../hooks/useShowTransition'; diff --git a/src/components/middle/MobileSearch.tsx b/src/components/middle/MobileSearch.tsx index c7d4fc634..6ece4e574 100644 --- a/src/components/middle/MobileSearch.tsx +++ b/src/components/middle/MobileSearch.tsx @@ -1,12 +1,12 @@ import React, { FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChat } from '../../api/types'; import { debounce } from '../../util/schedulers'; -import { selectCurrentTextSearch, selectCurrentChat } from '../../modules/selectors'; +import { selectCurrentTextSearch, selectCurrentChat } from '../../global/selectors'; import { getDayStartAt } from '../../util/dateFormat'; import Button from '../ui/Button'; diff --git a/src/components/middle/ReactorListModal.tsx b/src/components/middle/ReactorListModal.tsx index 7a0527509..857b3bd45 100644 --- a/src/components/middle/ReactorListModal.tsx +++ b/src/components/middle/ReactorListModal.tsx @@ -1,15 +1,15 @@ import React, { FC, useCallback, memo, useMemo, useEffect, useState, useRef, } from '../../lib/teact/teact'; -import { getActions, getGlobal, withGlobal } from '../../modules'; +import { getActions, getGlobal, withGlobal } from '../../global'; import { ApiMessage } from '../../api/types'; import { LoadMoreDirection } from '../../types'; import useLang from '../../hooks/useLang'; -import { selectChatMessage } from '../../modules/selectors'; +import { selectChatMessage } from '../../global/selectors'; import useInfiniteScroll from '../../hooks/useInfiniteScroll'; -import { getUserFullName } from '../../modules/helpers'; +import { getUserFullName } from '../../global/helpers'; import renderText from '../common/helpers/renderText'; import useFlag from '../../hooks/useFlag'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/middle/ScrollDownButton.tsx b/src/components/middle/ScrollDownButton.tsx index 480dd09ec..2bbb269bf 100644 --- a/src/components/middle/ScrollDownButton.tsx +++ b/src/components/middle/ScrollDownButton.tsx @@ -1,12 +1,12 @@ import React, { FC, useCallback, memo, useRef, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { MessageListType } from '../../global/types'; import { MAIN_THREAD_ID } from '../../api/types'; -import { selectChat, selectCurrentMessageList } from '../../modules/selectors'; +import { selectChat, selectCurrentMessageList } from '../../global/selectors'; import { formatIntegerCompact } from '../../util/textFormat'; import buildClassName from '../../util/buildClassName'; import fastSmoothScroll from '../../util/fastSmoothScroll'; diff --git a/src/components/middle/UserReportPanel.tsx b/src/components/middle/UserReportPanel.tsx index 0a4a8fd12..ece8e229e 100644 --- a/src/components/middle/UserReportPanel.tsx +++ b/src/components/middle/UserReportPanel.tsx @@ -1,12 +1,12 @@ import React, { FC, memo, useCallback, useState, } from '../../lib/teact/teact'; -import { withGlobal, getActions } from '../../modules'; +import { withGlobal, getActions } from '../../global'; import { ApiUser } from '../../api/types'; -import { selectUser } from '../../modules/selectors'; -import { getUserFirstOrLastName, getUserFullName } from '../../modules/helpers'; +import { selectUser } from '../../global/selectors'; +import { getUserFirstOrLastName, getUserFullName } from '../../global/helpers'; import useLang from '../../hooks/useLang'; import useFlag from '../../hooks/useFlag'; diff --git a/src/components/middle/composer/BotCommandMenu.tsx b/src/components/middle/composer/BotCommandMenu.tsx index e0fd1f684..022112c22 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 { getActions } from '../../../modules'; +import { getActions } from '../../../global'; export type OwnProps = { isOpen: boolean; diff --git a/src/components/middle/composer/BotCommandTooltip.tsx b/src/components/middle/composer/BotCommandTooltip.tsx index bfd6a61cf..dc129e258 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiBotCommand, ApiUser } from '../../../api/types'; diff --git a/src/components/middle/composer/BotKeyboardMenu.tsx b/src/components/middle/composer/BotKeyboardMenu.tsx index c12428244..68bf47875 100644 --- a/src/components/middle/composer/BotKeyboardMenu.tsx +++ b/src/components/middle/composer/BotKeyboardMenu.tsx @@ -1,10 +1,10 @@ import React, { FC, memo, useEffect } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiMessage } from '../../../api/types'; import { IS_TOUCH_ENV } from '../../../util/environment'; -import { selectChatMessage, selectCurrentMessageList } from '../../../modules/selectors'; +import { selectChatMessage, selectCurrentMessageList } from '../../../global/selectors'; import useMouseInside from '../../../hooks/useMouseInside'; import useFlag from '../../../hooks/useFlag'; diff --git a/src/components/middle/composer/Composer.tsx b/src/components/middle/composer/Composer.tsx index 968cb36e8..b53d22f8e 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 { getActions, getGlobal, withGlobal } from '../../../modules'; +import { getActions, getGlobal, withGlobal } from '../../../global'; import { GlobalState, MessageListType } from '../../../global/types'; import { @@ -40,7 +40,7 @@ import { selectChatMessage, selectUser, selectUserStatus, -} from '../../../modules/selectors'; +} from '../../../global/selectors'; import { getAllowedAttachmentOptions, getChatSlowModeOptions, @@ -48,7 +48,7 @@ import { isChatAdmin, isChatSuperGroup, isChatChannel, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat'; import focusEditableElement from '../../../util/focusEditableElement'; import parseMessageInput from '../../../util/parseMessageInput'; diff --git a/src/components/middle/composer/ComposerEmbeddedMessage.tsx b/src/components/middle/composer/ComposerEmbeddedMessage.tsx index 1cbcce32a..3ace90f08 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat, ApiMessage, ApiUser } from '../../../api/types'; @@ -16,12 +16,12 @@ import { selectEditingId, selectEditingScheduledId, selectEditingMessage, -} from '../../../modules/selectors'; +} from '../../../global/selectors'; import captureEscKeyListener from '../../../util/captureEscKeyListener'; import useAsyncRendering from '../../right/hooks/useAsyncRendering'; import useShowTransition from '../../../hooks/useShowTransition'; import buildClassName from '../../../util/buildClassName'; -import { isUserId } from '../../../modules/helpers'; +import { isUserId } from '../../../global/helpers'; import Button from '../../ui/Button'; import EmbeddedMessage from '../../common/EmbeddedMessage'; diff --git a/src/components/middle/composer/EmojiPicker.tsx b/src/components/middle/composer/EmojiPicker.tsx index 6d6fbe78e..07b7a08fc 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 '../../../modules'; +import { withGlobal } from '../../../global'; import { GlobalState } from '../../../global/types'; diff --git a/src/components/middle/composer/GifPicker.tsx b/src/components/middle/composer/GifPicker.tsx index 328310a38..dddc005db 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiVideo } from '../../../api/types'; diff --git a/src/components/middle/composer/InlineBotTooltip.tsx b/src/components/middle/composer/InlineBotTooltip.tsx index 7e44ddf96..cadfac0bc 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 { getActions } from '../../../modules'; +import { getActions } from '../../../global'; 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 f2d9fc272..aab74fcaa 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 '../../../modules'; +import { getGlobal } from '../../../global'; import { ApiUser } from '../../../api/types'; diff --git a/src/components/middle/composer/MessageInput.tsx b/src/components/middle/composer/MessageInput.tsx index 02fa1c3f5..a6bccdf17 100644 --- a/src/components/middle/composer/MessageInput.tsx +++ b/src/components/middle/composer/MessageInput.tsx @@ -2,12 +2,12 @@ import { ChangeEvent } from 'react'; import React, { FC, useEffect, useRef, memo, useState, useCallback, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { IAnchorPosition, ISettings } from '../../../types'; import { EDITABLE_INPUT_ID } from '../../../config'; -import { selectReplyingToId } from '../../../modules/selectors'; +import { selectReplyingToId } from '../../../global/selectors'; import { debounce } from '../../../util/schedulers'; import focusEditableElement from '../../../util/focusEditableElement'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/middle/composer/SendAsMenu.tsx b/src/components/middle/composer/SendAsMenu.tsx index 33dab9110..aeee7b1a5 100644 --- a/src/components/middle/composer/SendAsMenu.tsx +++ b/src/components/middle/composer/SendAsMenu.tsx @@ -6,11 +6,11 @@ import setTooltipItemVisible from '../../../util/setTooltipItemVisible'; import { useKeyboardNavigation } from './hooks/useKeyboardNavigation'; import { IS_TOUCH_ENV } from '../../../util/environment'; import renderText from '../../common/helpers/renderText'; -import { getUserFullName, isUserId } from '../../../modules/helpers'; +import { getUserFullName, isUserId } from '../../../global/helpers'; import useMouseInside from '../../../hooks/useMouseInside'; import useLang from '../../../hooks/useLang'; import buildClassName from '../../../util/buildClassName'; -import { getActions, getGlobal } from '../../../modules'; +import { getActions, getGlobal } from '../../../global'; 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 acba3de42..15b89ed3a 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; 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 bef4d1403..fcd4a56f9 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiSticker } from '../../../api/types'; diff --git a/src/components/middle/composer/SymbolMenu.tsx b/src/components/middle/composer/SymbolMenu.tsx index c6e221fe2..66b9477cd 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 '../../../modules'; +import { withGlobal } from '../../../global'; import { ApiSticker, ApiVideo } from '../../../api/types'; diff --git a/src/components/middle/composer/WebPagePreview.tsx b/src/components/middle/composer/WebPagePreview.tsx index 5a631bfa3..7333f0651 100644 --- a/src/components/middle/composer/WebPagePreview.tsx +++ b/src/components/middle/composer/WebPagePreview.tsx @@ -1,11 +1,11 @@ import React, { FC, memo, useEffect } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiMessage, ApiMessageEntityTypes, ApiWebPage } from '../../../api/types'; import { ISettings } from '../../../types'; import { RE_LINK_TEMPLATE } from '../../../config'; -import { selectNoWebPage, selectTheme } from '../../../modules/selectors'; +import { selectNoWebPage, selectTheme } from '../../../global/selectors'; import parseMessageInput from '../../../util/parseMessageInput'; import useOnChange from '../../../hooks/useOnChange'; import useShowTransition from '../../../hooks/useShowTransition'; diff --git a/src/components/middle/composer/hooks/useDraft.ts b/src/components/middle/composer/hooks/useDraft.ts index ba3f15f72..c3f4b1535 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 { getActions } from '../../../../modules'; +import { getActions } from '../../../../global'; 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 705294fb8..fbd8b05cd 100644 --- a/src/components/middle/composer/hooks/useEditing.ts +++ b/src/components/middle/composer/hooks/useEditing.ts @@ -1,12 +1,12 @@ import { useCallback } from '../../../../lib/teact/teact'; -import { getActions } from '../../../../modules'; +import { getActions } from '../../../../global'; import { ApiMessage } from '../../../../api/types'; import { EDITABLE_INPUT_ID } from '../../../../config'; import parseMessageInput from '../../../../util/parseMessageInput'; import focusEditableElement from '../../../../util/focusEditableElement'; -import { hasMessageMedia } from '../../../../modules/helpers'; +import { hasMessageMedia } from '../../../../global/helpers'; import { getTextWithEntitiesAsHtml } from '../../../common/helpers/renderTextWithEntities'; import useOnChange from '../../../../hooks/useOnChange'; diff --git a/src/components/middle/composer/hooks/useInlineBotTooltip.ts b/src/components/middle/composer/hooks/useInlineBotTooltip.ts index da8910ed1..62d695003 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 { getActions } from '../../../../modules'; +import { getActions } from '../../../../global'; 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 0b6a29eb7..9e0ddaa86 100644 --- a/src/components/middle/composer/hooks/useMentionTooltip.ts +++ b/src/components/middle/composer/hooks/useMentionTooltip.ts @@ -1,11 +1,11 @@ import { useCallback, useEffect, useState, } from '../../../../lib/teact/teact'; -import { getGlobal } from '../../../../modules'; +import { getGlobal } from '../../../../global'; import { ApiMessageEntityTypes, ApiChatMember, ApiUser } from '../../../../api/types'; import { EDITABLE_INPUT_ID } from '../../../../config'; -import { filterUsersByName, getUserFirstOrLastName } from '../../../../modules/helpers'; +import { filterUsersByName, getUserFirstOrLastName } from '../../../../global/helpers'; import { prepareForRegExp } from '../helpers/prepareForRegExp'; import focusEditableElement from '../../../../util/focusEditableElement'; import useFlag from '../../../../hooks/useFlag'; diff --git a/src/components/middle/composer/hooks/useStickerTooltip.ts b/src/components/middle/composer/hooks/useStickerTooltip.ts index 465f78f7c..1eb618061 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 { getActions } from '../../../../modules'; +import { getActions } from '../../../../global'; import { ApiSticker } from '../../../../api/types'; diff --git a/src/components/middle/helpers/groupMessages.ts b/src/components/middle/helpers/groupMessages.ts index 0b977f1ae..07331d899 100644 --- a/src/components/middle/helpers/groupMessages.ts +++ b/src/components/middle/helpers/groupMessages.ts @@ -2,7 +2,7 @@ import { ApiMessage } from '../../../api/types'; import { IAlbum } from '../../../types'; import { getDayStartAt } from '../../../util/dateFormat'; -import { isActionMessage } from '../../../modules/helpers'; +import { isActionMessage } from '../../../global/helpers'; type SenderGroup = (ApiMessage | IAlbum)[]; diff --git a/src/components/middle/hooks/useMessageObservers.ts b/src/components/middle/hooks/useMessageObservers.ts index 32387a2c0..7595013c8 100644 --- a/src/components/middle/hooks/useMessageObservers.ts +++ b/src/components/middle/hooks/useMessageObservers.ts @@ -1,5 +1,5 @@ import { RefObject } from 'react'; -import { getActions } from '../../../modules'; +import { getActions } from '../../../global'; import { MessageListType } from '../../../global/types'; diff --git a/src/components/middle/hooks/useScrollHooks.ts b/src/components/middle/hooks/useScrollHooks.ts index 633614f7d..10042a532 100644 --- a/src/components/middle/hooks/useScrollHooks.ts +++ b/src/components/middle/hooks/useScrollHooks.ts @@ -1,5 +1,5 @@ import { RefObject } from 'react'; -import { getActions } from '../../../modules'; +import { getActions } from '../../../global'; 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 1178be40b..5d5f63367 100644 --- a/src/components/middle/message/Album.tsx +++ b/src/components/middle/message/Album.tsx @@ -5,8 +5,8 @@ import { ApiMessage } from '../../../api/types'; import { IAlbum, ISettings } from '../../../types'; import { AlbumRectPart, IAlbumLayout } from './helpers/calculateAlbumLayout'; -import { getMessageContent, getMessageHtmlId } from '../../../modules/helpers'; -import { getActions, getGlobal, withGlobal } from '../../../modules'; +import { getMessageContent, getMessageHtmlId } from '../../../global/helpers'; +import { getActions, getGlobal, withGlobal } from '../../../global'; import withSelectControl from './hocs/withSelectControl'; import { ObserveFn } from '../../../hooks/useIntersectionObserver'; import { @@ -14,7 +14,7 @@ import { selectCanAutoLoadMedia, selectCanAutoPlayMedia, selectTheme, -} from '../../../modules/selectors'; +} from '../../../global/selectors'; import Photo from './Photo'; import Video from './Video'; diff --git a/src/components/middle/message/CommentButton.tsx b/src/components/middle/message/CommentButton.tsx index e0a5625b7..a6faca13d 100644 --- a/src/components/middle/message/CommentButton.tsx +++ b/src/components/middle/message/CommentButton.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getActions, getGlobal } from '../../../modules'; +import { getActions, getGlobal } from '../../../global'; import { ApiChat, ApiThreadInfo, ApiUser, } from '../../../api/types'; -import { isUserId } from '../../../modules/helpers'; +import { isUserId } from '../../../global/helpers'; import { formatIntegerCompact } from '../../../util/textFormat'; import buildClassName from '../../../util/buildClassName'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/middle/message/Contact.tsx b/src/components/middle/message/Contact.tsx index 465fbb29c..98a1abbcf 100644 --- a/src/components/middle/message/Contact.tsx +++ b/src/components/middle/message/Contact.tsx @@ -1,9 +1,9 @@ import React, { FC, useCallback } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiUser, ApiContact, ApiCountryCode } from '../../../api/types'; -import { selectUser } from '../../../modules/selectors'; +import { selectUser } from '../../../global/selectors'; import { formatPhoneNumberWithCode } from '../../../util/phoneNumber'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/middle/message/ContextMenuContainer.tsx b/src/components/middle/message/ContextMenuContainer.tsx index 5f4158d9a..8f67b01c5 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 { getActions, getGlobal, withGlobal } from '../../../modules'; +import { getActions, getGlobal, withGlobal } from '../../../global'; import { MessageListType } from '../../../global/types'; import { ApiAvailableReaction, ApiMessage } from '../../../api/types'; @@ -12,11 +12,11 @@ import { selectChat, selectCurrentMessageList, selectIsMessageProtected, -} from '../../../modules/selectors'; +} from '../../../global/selectors'; import { isActionMessage, isChatChannel, isChatGroup, isOwnMessage, areReactionsEmpty, isUserId, isMessageLocal, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import { SERVICE_NOTIFICATIONS_USER_ID } from '../../../config'; import { getDayStartAt } from '../../../util/dateFormat'; import { copyTextToClipboard } from '../../../util/clipboard'; diff --git a/src/components/middle/message/Invoice.tsx b/src/components/middle/message/Invoice.tsx index ffa4919eb..31436bf93 100644 --- a/src/components/middle/message/Invoice.tsx +++ b/src/components/middle/message/Invoice.tsx @@ -2,7 +2,7 @@ import React, { FC, memo } from '../../../lib/teact/teact'; import { ApiMessage } from '../../../api/types'; -import { getMessageInvoice } from '../../../modules/helpers'; +import { getMessageInvoice } from '../../../global/helpers'; import { formatCurrency } from '../../../util/formatCurrency'; import renderText from '../../common/helpers/renderText'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/middle/message/Location.tsx b/src/components/middle/message/Location.tsx index bbcefdcc5..e5e53133f 100644 --- a/src/components/middle/message/Location.tsx +++ b/src/components/middle/message/Location.tsx @@ -12,7 +12,7 @@ import { isGeoLiveExpired, isOwnMessage, isUserId, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import useMedia from '../../../hooks/useMedia'; import getCustomAppendixBg from './helpers/getCustomAppendixBg'; import { formatCountdownShort, formatLastUpdated } from '../../../util/dateFormat'; diff --git a/src/components/middle/message/MentionLink.tsx b/src/components/middle/message/MentionLink.tsx index 4afb024d2..df7310734 100644 --- a/src/components/middle/message/MentionLink.tsx +++ b/src/components/middle/message/MentionLink.tsx @@ -1,9 +1,9 @@ import React, { FC } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat, ApiUser } from '../../../api/types'; -import { selectUser } from '../../../modules/selectors'; +import { selectUser } from '../../../global/selectors'; type OwnProps = { userId?: string; diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx index 1fc67b1b4..ea893e60b 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ActiveEmojiInteraction, ActiveReaction, MessageListType } from '../../../global/types'; import { @@ -53,7 +53,7 @@ import { selectIsMessageProtected, selectLocalAnimatedEmojiEffect, selectDefaultReaction, -} from '../../../modules/selectors'; +} from '../../../global/selectors'; import { getMessageContent, isOwnMessage, @@ -70,7 +70,7 @@ import { areReactionsEmpty, getMessageHtmlId, isGeoLiveExpired, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; import useEnsureMessage from '../../../hooks/useEnsureMessage'; import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers'; diff --git a/src/components/middle/message/MessageContextMenu.tsx b/src/components/middle/message/MessageContextMenu.tsx index d77464d0c..a891f2cba 100644 --- a/src/components/middle/message/MessageContextMenu.tsx +++ b/src/components/middle/message/MessageContextMenu.tsx @@ -7,7 +7,7 @@ import { IAnchorPosition } from '../../../types'; import { getMessageCopyOptions } from './helpers/copyOptions'; import { disableScrolling, enableScrolling } from '../../../util/scrollLock'; -import { getUserFullName } from '../../../modules/helpers'; +import { getUserFullName } from '../../../global/helpers'; import useContextMenuPosition from '../../../hooks/useContextMenuPosition'; import useLang from '../../../hooks/useLang'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/middle/message/Photo.tsx b/src/components/middle/message/Photo.tsx index a1632650e..cfe3b9f26 100644 --- a/src/components/middle/message/Photo.tsx +++ b/src/components/middle/message/Photo.tsx @@ -13,7 +13,7 @@ import { getMessageMediaHash, getMediaTransferState, isOwnMessage, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver'; import useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress'; import useShowTransition from '../../../hooks/useShowTransition'; diff --git a/src/components/middle/message/Poll.tsx b/src/components/middle/message/Poll.tsx index 259818874..0cdd25980 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiMessage, ApiPoll, ApiUser, ApiPollAnswer, diff --git a/src/components/middle/message/ReactionAnimatedEmoji.tsx b/src/components/middle/message/ReactionAnimatedEmoji.tsx index 27359a843..9001e9d7b 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 { getActions } from '../../../modules'; +import { getActions } from '../../../global'; 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 a6fa02383..c7d1ec6b2 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 { getActions, getGlobal } from '../../../modules'; +import { getActions, getGlobal } from '../../../global'; import { ApiAvailableReaction, ApiMessage, ApiReactionCount, ApiUser, diff --git a/src/components/middle/message/RoundVideo.tsx b/src/components/middle/message/RoundVideo.tsx index 7482b0ac5..faa4cdeac 100644 --- a/src/components/middle/message/RoundVideo.tsx +++ b/src/components/middle/message/RoundVideo.tsx @@ -5,12 +5,12 @@ import React, { useRef, useState, } from '../../../lib/teact/teact'; -import { getActions } from '../../../modules'; +import { getActions } from '../../../global'; import { ApiMediaFormat, ApiMessage } from '../../../api/types'; import { ROUND_VIDEO_DIMENSIONS_PX } from '../../common/helpers/mediaDimensions'; -import { getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers'; +import { getMessageMediaFormat, getMessageMediaHash } from '../../../global/helpers'; import { formatMediaDuration } from '../../../util/dateFormat'; import buildClassName from '../../../util/buildClassName'; import { stopCurrentAudio } from '../../../util/audioPlayer'; diff --git a/src/components/middle/message/SponsoredMessage.tsx b/src/components/middle/message/SponsoredMessage.tsx index 95c43d808..f066aad11 100644 --- a/src/components/middle/message/SponsoredMessage.tsx +++ b/src/components/middle/message/SponsoredMessage.tsx @@ -2,13 +2,13 @@ import { RefObject } from 'react'; import React, { FC, memo, useEffect, useRef, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat, ApiSponsoredMessage, ApiUser } from '../../../api/types'; import { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities'; -import { selectChat, selectSponsoredMessage, selectUser } from '../../../modules/selectors'; -import { getChatTitle, getUserFullName } from '../../../modules/helpers'; +import { selectChat, selectSponsoredMessage, selectUser } from '../../../global/selectors'; +import { getChatTitle, getUserFullName } from '../../../global/helpers'; import renderText from '../../common/helpers/renderText'; import useLang from '../../../hooks/useLang'; import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver'; diff --git a/src/components/middle/message/Sticker.tsx b/src/components/middle/message/Sticker.tsx index f407e0510..7a18fb448 100644 --- a/src/components/middle/message/Sticker.tsx +++ b/src/components/middle/message/Sticker.tsx @@ -4,7 +4,7 @@ import { ApiMessage } from '../../../api/types'; import { NO_STICKER_SET_ID } from '../../../config'; import { getStickerDimensions } from '../../common/helpers/mediaDimensions'; -import { getMessageHtmlId, getMessageMediaFormat, getMessageMediaHash } from '../../../modules/helpers'; +import { getMessageHtmlId, getMessageMediaFormat, getMessageMediaHash } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; import { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver'; import useMedia from '../../../hooks/useMedia'; diff --git a/src/components/middle/message/Video.tsx b/src/components/middle/message/Video.tsx index 2a9556bc6..af74e9b31 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 { getActions } from '../../../modules'; +import { getActions } from '../../../global'; import { ApiMediaFormat, ApiMessage } from '../../../api/types'; import { IMediaDimensions } from './helpers/calculateAlbumLayout'; @@ -17,7 +17,7 @@ import { getMessageWebPageVideo, isForwardedMessage, isOwnMessage, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver'; import useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress'; import useMedia from '../../../hooks/useMedia'; diff --git a/src/components/middle/message/WebPage.tsx b/src/components/middle/message/WebPage.tsx index 8a9859c54..838e04334 100644 --- a/src/components/middle/message/WebPage.tsx +++ b/src/components/middle/message/WebPage.tsx @@ -4,7 +4,7 @@ import { ApiMessage } from '../../../api/types'; import { ObserveFn } from '../../../hooks/useIntersectionObserver'; import { ISettings } from '../../../types'; -import { getMessageWebPage } from '../../../modules/helpers'; +import { getMessageWebPage } from '../../../global/helpers'; import { calculateMediaDimensions } from './helpers/mediaDimensions'; import renderText from '../../common/helpers/renderText'; import trimText from '../../../util/trimText'; diff --git a/src/components/middle/message/helpers/buildContentClassName.ts b/src/components/middle/message/helpers/buildContentClassName.ts index af5cab0ef..627e4c2ae 100644 --- a/src/components/middle/message/helpers/buildContentClassName.ts +++ b/src/components/middle/message/helpers/buildContentClassName.ts @@ -1,6 +1,6 @@ import { ApiMessage } from '../../../../api/types'; -import { getMessageContent } from '../../../../modules/helpers'; +import { getMessageContent } from '../../../../global/helpers'; export function isEmojiOnlyMessage(customShape?: boolean | number) { return typeof customShape === 'number'; diff --git a/src/components/middle/message/helpers/copyOptions.ts b/src/components/middle/message/helpers/copyOptions.ts index 080b7cbb4..a7cc092bc 100644 --- a/src/components/middle/message/helpers/copyOptions.ts +++ b/src/components/middle/message/helpers/copyOptions.ts @@ -9,7 +9,7 @@ import { getMessageWebPagePhoto, getMessageWebPageVideo, hasMessageLocalBlobUrl, -} from '../../../../modules/helpers'; +} from '../../../../global/helpers'; import { CLIPBOARD_ITEM_SUPPORTED, copyImageToClipboard, copyTextToClipboard } from '../../../../util/clipboard'; import getMessageIdsForSelectedText from '../../../../util/getMessageIdsForSelectedText'; diff --git a/src/components/middle/message/helpers/mediaDimensions.ts b/src/components/middle/message/helpers/mediaDimensions.ts index 3d7da05df..942fdacda 100644 --- a/src/components/middle/message/helpers/mediaDimensions.ts +++ b/src/components/middle/message/helpers/mediaDimensions.ts @@ -7,7 +7,7 @@ import { isForwardedMessage, isOwnMessage, getMessageVideo, -} from '../../../../modules/helpers'; +} from '../../../../global/helpers'; const MIN_MEDIA_WIDTH = 100; const MIN_MEDIA_WIDTH_WITH_COMMENTS = 238; diff --git a/src/components/middle/message/hocs/withSelectControl.tsx b/src/components/middle/message/hocs/withSelectControl.tsx index 65d1cfb44..88fc339fc 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 { getActions, withGlobal } from '../../../../modules'; +import { getActions, withGlobal } from '../../../../global'; import { OwnProps as PhotoProps } from '../Photo'; import { OwnProps as VideoProps } from '../Video'; @@ -14,7 +14,7 @@ import buildClassName from '../../../../util/buildClassName'; import { selectIsInSelectMode, selectIsMessageSelected, -} from '../../../../modules/selectors'; +} from '../../../../global/selectors'; type OwnProps = PhotoProps diff --git a/src/components/middle/message/hooks/useBlurredMediaThumbRef.ts b/src/components/middle/message/hooks/useBlurredMediaThumbRef.ts index d8936f211..01a0cfc04 100644 --- a/src/components/middle/message/hooks/useBlurredMediaThumbRef.ts +++ b/src/components/middle/message/hooks/useBlurredMediaThumbRef.ts @@ -1,7 +1,7 @@ import { ApiMessage } from '../../../../api/types'; import { IS_CANVAS_FILTER_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT } from '../../../../util/environment'; -import { getMessageMediaThumbDataUri } from '../../../../modules/helpers'; +import { getMessageMediaThumbDataUri } from '../../../../global/helpers'; import useCanvasBlur from '../../../../hooks/useCanvasBlur'; export default function useBlurredMediaThumbRef(message: ApiMessage, fullMediaData?: string) { diff --git a/src/components/middle/message/hooks/useInnerHandlers.ts b/src/components/middle/message/hooks/useInnerHandlers.ts index 28a7440aa..66e3e01a5 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 { getActions } from '../../../../modules'; +import { getActions } from '../../../../global'; 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 50b556db1..16011aebb 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 { getActions } from '../../../../modules'; +import { getActions } from '../../../../global'; 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 56a52870b..976bba382 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; 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 2a986e206..9184e30b1 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 '../../modules'; +import { withGlobal } from '../../global'; import { Price } from '../../types'; import { ApiShippingAddress } from '../../api/types'; diff --git a/src/components/right/AddChatMembers.tsx b/src/components/right/AddChatMembers.tsx index 85d6ec38e..3e7bc3645 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 { getActions, getGlobal, withGlobal } from '../../modules'; +import { getActions, getGlobal, withGlobal } from '../../global'; import { ApiChat, ApiChatMember, ApiUpdateConnectionStateType, @@ -9,10 +9,10 @@ import { import { NewChatMembersProgress } from '../../types'; import { unique } from '../../util/iteratees'; -import { selectChat } from '../../modules/selectors'; +import { selectChat } from '../../global/selectors'; import { filterUsersByName, isChatChannel, isUserBot, sortChatIds, -} from '../../modules/helpers'; +} from '../../global/helpers'; import useLang from '../../hooks/useLang'; import usePrevious from '../../hooks/usePrevious'; import useHistoryBack from '../../hooks/useHistoryBack'; diff --git a/src/components/right/DeleteMemberModal.tsx b/src/components/right/DeleteMemberModal.tsx index f71404a58..9e1921ac7 100644 --- a/src/components/right/DeleteMemberModal.tsx +++ b/src/components/right/DeleteMemberModal.tsx @@ -1,10 +1,10 @@ import React, { FC, useCallback, memo } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChat } from '../../api/types'; -import { selectCurrentChat, selectUser } from '../../modules/selectors'; -import { getUserFirstOrLastName } from '../../modules/helpers'; +import { selectCurrentChat, selectUser } from '../../global/selectors'; +import { getUserFirstOrLastName } from '../../global/helpers'; import renderText from '../common/helpers/renderText'; import useLang from '../../hooks/useLang'; diff --git a/src/components/right/GifSearch.tsx b/src/components/right/GifSearch.tsx index 904a6c749..6680cb16f 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChat, ApiVideo } from '../../api/types'; @@ -11,8 +11,8 @@ import { selectChat, selectIsChatWithBot, selectCurrentMessageList, -} from '../../modules/selectors'; -import { getAllowedAttachmentOptions } from '../../modules/helpers'; +} from '../../global/selectors'; +import { getAllowedAttachmentOptions } from '../../global/helpers'; import buildClassName from '../../util/buildClassName'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; import useLang from '../../hooks/useLang'; diff --git a/src/components/right/PollAnswerResults.tsx b/src/components/right/PollAnswerResults.tsx index 763c53ae9..1531ac162 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiChat, diff --git a/src/components/right/PollResults.tsx b/src/components/right/PollResults.tsx index 4df7a3ac2..a7f52786b 100644 --- a/src/components/right/PollResults.tsx +++ b/src/components/right/PollResults.tsx @@ -1,10 +1,10 @@ import React, { FC, memo } from '../../lib/teact/teact'; -import { withGlobal } from '../../modules'; +import { withGlobal } from '../../global'; import { ApiMessage, ApiChat } from '../../api/types'; -import { selectChat, selectChatMessage } from '../../modules/selectors'; +import { selectChat, selectChatMessage } from '../../global/selectors'; import { buildCollectionByKey } from '../../util/iteratees'; -import { getMessagePoll } from '../../modules/helpers'; +import { getMessagePoll } from '../../global/helpers'; import renderText from '../common/helpers/renderText'; import useLang from '../../hooks/useLang'; import useHistoryBack from '../../hooks/useHistoryBack'; diff --git a/src/components/right/Profile.tsx b/src/components/right/Profile.tsx index 7a75d8f87..9bdf899f1 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { MAIN_THREAD_ID, @@ -24,7 +24,7 @@ import { import { IS_TOUCH_ENV } from '../../util/environment'; import { getHasAdminRight, isChatAdmin, isChatChannel, isChatGroup, isUserBot, isUserId, -} from '../../modules/helpers'; +} from '../../global/helpers'; import { selectChatMessages, selectChat, @@ -33,7 +33,7 @@ import { selectTheme, selectActiveDownloadIds, selectUser, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { captureEvents, SwipeDirection } from '../../util/captureEvents'; import { getSenderName } from '../left/search/helpers/getSenderName'; import useCacheBuster from '../../hooks/useCacheBuster'; diff --git a/src/components/right/RightColumn.tsx b/src/components/right/RightColumn.tsx index bc7e6bf2b..97af28423 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ManagementScreens, NewChatMembersProgress, ProfileState, RightColumnContent, @@ -13,7 +13,7 @@ import { selectAreActiveChatsLoaded, selectCurrentMessageList, selectRightColumnContentKey, -} from '../../modules/selectors'; +} from '../../global/selectors'; import useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps'; import useWindowSize from '../../hooks/useWindowSize'; import useHistoryBack from '../../hooks/useHistoryBack'; diff --git a/src/components/right/RightHeader.tsx b/src/components/right/RightHeader.tsx index a4d38e50a..6764b318b 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 { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ManagementScreens, ProfileState } from '../../types'; import { ApiExportedInvite } from '../../api/types'; @@ -16,10 +16,10 @@ import { selectCurrentTextSearch, selectIsChatWithSelf, selectUser, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { getCanAddContact, isChatAdmin, isChatChannel, isUserId, -} from '../../modules/helpers'; +} from '../../global/helpers'; import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; import useLang from '../../hooks/useLang'; import useFlag from '../../hooks/useFlag'; diff --git a/src/components/right/RightSearch.tsx b/src/components/right/RightSearch.tsx index 286843b3c..58969cd55 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 { getActions, getGlobal, withGlobal } from '../../modules'; +import { getActions, getGlobal, withGlobal } from '../../global'; import { ApiMessage, ApiUser, ApiChat } from '../../api/types'; @@ -11,12 +11,12 @@ import { selectChatMessages, selectChat, selectCurrentTextSearch, -} from '../../modules/selectors'; +} from '../../global/selectors'; import { getChatTitle, getUserFullName, isChatChannel, -} from '../../modules/helpers'; +} from '../../global/helpers'; import useLang from '../../hooks/useLang'; import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation'; import useHistoryBack from '../../hooks/useHistoryBack'; diff --git a/src/components/right/StickerSearch.tsx b/src/components/right/StickerSearch.tsx index f9ee6114b..6935caf3f 100644 --- a/src/components/right/StickerSearch.tsx +++ b/src/components/right/StickerSearch.tsx @@ -1,10 +1,10 @@ import React, { FC, memo, useEffect, useRef, useState, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { throttle } from '../../util/schedulers'; -import { selectCurrentStickerSearch } from '../../modules/selectors'; +import { selectCurrentStickerSearch } from '../../global/selectors'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; import useLang from '../../hooks/useLang'; import useHistoryBack from '../../hooks/useHistoryBack'; diff --git a/src/components/right/StickerSetResult.tsx b/src/components/right/StickerSetResult.tsx index 599220675..e19c2cabe 100644 --- a/src/components/right/StickerSetResult.tsx +++ b/src/components/right/StickerSetResult.tsx @@ -1,13 +1,13 @@ import React, { FC, useEffect, memo, useMemo, useCallback, } from '../../lib/teact/teact'; -import { getActions, withGlobal } from '../../modules'; +import { getActions, withGlobal } from '../../global'; import { ApiStickerSet } from '../../api/types'; import { ObserveFn } from '../../hooks/useIntersectionObserver'; import { STICKER_SIZE_SEARCH } from '../../config'; -import { selectShouldLoopStickers, selectStickerSet } from '../../modules/selectors'; +import { selectShouldLoopStickers, selectStickerSet } from '../../global/selectors'; import useFlag from '../../hooks/useFlag'; import useOnChange from '../../hooks/useOnChange'; import useLang from '../../hooks/useLang'; diff --git a/src/components/right/hooks/useProfileViewportIds.ts b/src/components/right/hooks/useProfileViewportIds.ts index e526690c0..e6e5b0572 100644 --- a/src/components/right/hooks/useProfileViewportIds.ts +++ b/src/components/right/hooks/useProfileViewportIds.ts @@ -6,7 +6,7 @@ import { import { ProfileTabType, SharedMediaType } from '../../../types'; import { MEMBERS_SLICE, MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config'; -import { getMessageContentIds, sortChatIds, sortUserIds } from '../../../modules/helpers'; +import { getMessageContentIds, sortChatIds, sortUserIds } from '../../../global/helpers'; import useOnChange from '../../../hooks/useOnChange'; import useInfiniteScroll from '../../../hooks/useInfiniteScroll'; diff --git a/src/components/right/management/JoinRequest.tsx b/src/components/right/management/JoinRequest.tsx index fabb16387..0bee9c614 100644 --- a/src/components/right/management/JoinRequest.tsx +++ b/src/components/right/management/JoinRequest.tsx @@ -1,11 +1,11 @@ import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiUser } from '../../../api/types'; import useLang from '../../../hooks/useLang'; -import { getUserFullName } from '../../../modules/helpers'; -import { selectUser } from '../../../modules/selectors'; +import { getUserFullName } from '../../../global/helpers'; +import { selectUser } from '../../../global/selectors'; import { formatHumanDate, formatTime, isToday } from '../../../util/dateFormat'; import { getServerTime } from '../../../util/serverTime'; import { createClassNameBuilder } from '../../../util/buildClassName'; diff --git a/src/components/right/management/ManageChannel.tsx b/src/components/right/management/ManageChannel.tsx index f427d6237..625acb756 100644 --- a/src/components/right/management/ManageChannel.tsx +++ b/src/components/right/management/ManageChannel.tsx @@ -2,15 +2,15 @@ import { ChangeEvent } from 'react'; import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ManagementScreens, ManagementProgress } from '../../../types'; import { ApiChat, ApiExportedInvite, ApiMediaFormat } from '../../../api/types'; -import { getChatAvatarHash, getHasAdminRight } from '../../../modules/helpers'; +import { getChatAvatarHash, getHasAdminRight } from '../../../global/helpers'; import useMedia from '../../../hooks/useMedia'; import useLang from '../../../hooks/useLang'; -import { selectChat } from '../../../modules/selectors'; +import { selectChat } from '../../../global/selectors'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; import { formatInteger } from '../../../util/textFormat'; diff --git a/src/components/right/management/ManageChatAdministrators.tsx b/src/components/right/management/ManageChatAdministrators.tsx index b05b568ff..967dff162 100644 --- a/src/components/right/management/ManageChatAdministrators.tsx +++ b/src/components/right/management/ManageChatAdministrators.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getGlobal, withGlobal } from '../../../modules'; +import { getGlobal, withGlobal } from '../../../global'; import { ManagementScreens } from '../../../types'; import { ApiChat, ApiChatMember } from '../../../api/types'; -import { getUserFullName, isChatChannel } from '../../../modules/helpers'; -import { selectChat } from '../../../modules/selectors'; +import { getUserFullName, isChatChannel } from '../../../global/helpers'; +import { selectChat } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/right/management/ManageChatPrivacyType.tsx b/src/components/right/management/ManageChatPrivacyType.tsx index 7dc686662..eaecf21c1 100644 --- a/src/components/right/management/ManageChatPrivacyType.tsx +++ b/src/components/right/management/ManageChatPrivacyType.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat } from '../../../api/types'; import { ManagementProgress } from '../../../types'; -import { selectChat, selectManagement } from '../../../modules/selectors'; -import { isChatChannel } from '../../../modules/helpers'; +import { selectChat, selectManagement } from '../../../global/selectors'; +import { isChatChannel } from '../../../global/helpers'; import useFlag from '../../../hooks/useFlag'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/right/management/ManageChatRemovedUsers.tsx b/src/components/right/management/ManageChatRemovedUsers.tsx index d82fbab07..caccd8a23 100644 --- a/src/components/right/management/ManageChatRemovedUsers.tsx +++ b/src/components/right/management/ManageChatRemovedUsers.tsx @@ -1,12 +1,12 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat, ApiChatMember, ApiUser } from '../../../api/types'; -import { selectChat } from '../../../modules/selectors'; -import { getHasAdminRight, getUserFullName, isChatChannel } from '../../../modules/helpers'; +import { selectChat } from '../../../global/selectors'; +import { getHasAdminRight, getUserFullName, isChatChannel } from '../../../global/helpers'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; import useFlag from '../../../hooks/useFlag'; diff --git a/src/components/right/management/ManageDiscussion.tsx b/src/components/right/management/ManageDiscussion.tsx index efe6753ce..a4ea0c2c1 100644 --- a/src/components/right/management/ManageDiscussion.tsx +++ b/src/components/right/management/ManageDiscussion.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat } from '../../../api/types'; import { ManagementScreens } from '../../../types'; import { STICKER_SIZE_DISCUSSION_GROUPS } from '../../../config'; -import { selectChat } from '../../../modules/selectors'; +import { selectChat } from '../../../global/selectors'; import getAnimationData from '../../common/helpers/animatedAssets'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; @@ -20,7 +20,7 @@ import ConfirmDialog from '../../ui/ConfirmDialog'; import useFlag from '../../../hooks/useFlag'; import renderText from '../../common/helpers/renderText'; import Avatar from '../../common/Avatar'; -import { isChatChannel } from '../../../modules/helpers'; +import { isChatChannel } from '../../../global/helpers'; type OwnProps = { chatId: string; diff --git a/src/components/right/management/ManageGroup.tsx b/src/components/right/management/ManageGroup.tsx index 6ce62e40e..1e0da5a85 100644 --- a/src/components/right/management/ManageGroup.tsx +++ b/src/components/right/management/ManageGroup.tsx @@ -2,18 +2,18 @@ import { ChangeEvent } from 'react'; import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ManagementScreens, ManagementProgress } from '../../../types'; import { ApiChat, ApiChatBannedRights, ApiExportedInvite, ApiMediaFormat, } from '../../../api/types'; -import { getChatAvatarHash, getHasAdminRight, isChatBasicGroup } from '../../../modules/helpers'; +import { getChatAvatarHash, getHasAdminRight, isChatBasicGroup } from '../../../global/helpers'; import useMedia from '../../../hooks/useMedia'; import useLang from '../../../hooks/useLang'; import useFlag from '../../../hooks/useFlag'; -import { selectChat } from '../../../modules/selectors'; +import { selectChat } from '../../../global/selectors'; import { formatInteger } from '../../../util/textFormat'; import renderText from '../../common/helpers/renderText'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/right/management/ManageGroupAdminRights.tsx b/src/components/right/management/ManageGroupAdminRights.tsx index 56d3c8b9a..06cbc91b7 100644 --- a/src/components/right/management/ManageGroupAdminRights.tsx +++ b/src/components/right/management/ManageGroupAdminRights.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getActions, getGlobal, withGlobal } from '../../../modules'; +import { getActions, getGlobal, withGlobal } from '../../../global'; import { ApiChat, ApiChatAdminRights, ApiUser } from '../../../api/types'; import { ManagementScreens } from '../../../types'; -import { selectChat } from '../../../modules/selectors'; -import { getUserFullName, isChatBasicGroup, isChatChannel } from '../../../modules/helpers'; +import { selectChat } from '../../../global/selectors'; +import { getUserFullName, isChatBasicGroup, isChatChannel } from '../../../global/helpers'; import useLang from '../../../hooks/useLang'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/right/management/ManageGroupMembers.tsx b/src/components/right/management/ManageGroupMembers.tsx index 9cdf8e415..3086d3b84 100644 --- a/src/components/right/management/ManageGroupMembers.tsx +++ b/src/components/right/management/ManageGroupMembers.tsx @@ -1,16 +1,16 @@ import React, { FC, memo, useCallback, useMemo, useRef, } from '../../../lib/teact/teact'; -import { getActions, getGlobal, withGlobal } from '../../../modules'; +import { getActions, getGlobal, withGlobal } from '../../../global'; import { ApiChatMember, ApiUserStatus } from '../../../api/types'; import { ManagementScreens } from '../../../types'; import { unique } from '../../../util/iteratees'; -import { selectChat } from '../../../modules/selectors'; +import { selectChat } from '../../../global/selectors'; import { sortUserIds, isChatChannel, filterUsersByName, sortChatIds, isUserBot, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; import useInfiniteScroll from '../../../hooks/useInfiniteScroll'; diff --git a/src/components/right/management/ManageGroupPermissions.tsx b/src/components/right/management/ManageGroupPermissions.tsx index c92a82932..3eed5f781 100644 --- a/src/components/right/management/ManageGroupPermissions.tsx +++ b/src/components/right/management/ManageGroupPermissions.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ManagementScreens } from '../../../types'; import { ApiChat, ApiChatBannedRights, ApiChatMember } from '../../../api/types'; import useLang from '../../../hooks/useLang'; -import { selectChat } from '../../../modules/selectors'; +import { selectChat } from '../../../global/selectors'; import useHistoryBack from '../../../hooks/useHistoryBack'; import ListItem from '../../ui/ListItem'; diff --git a/src/components/right/management/ManageGroupRecentActions.tsx b/src/components/right/management/ManageGroupRecentActions.tsx index c01bb5fc2..4257b015f 100644 --- a/src/components/right/management/ManageGroupRecentActions.tsx +++ b/src/components/right/management/ManageGroupRecentActions.tsx @@ -1,11 +1,11 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../modules'; +import { withGlobal } from '../../../global'; import { ApiChat, ApiChatMember } from '../../../api/types'; import useLang from '../../../hooks/useLang'; -import { selectChat } from '../../../modules/selectors'; +import { selectChat } from '../../../global/selectors'; import useHistoryBack from '../../../hooks/useHistoryBack'; import ListItem from '../../ui/ListItem'; diff --git a/src/components/right/management/ManageGroupUserPermissions.tsx b/src/components/right/management/ManageGroupUserPermissions.tsx index 9ff3277c7..88063ea67 100644 --- a/src/components/right/management/ManageGroupUserPermissions.tsx +++ b/src/components/right/management/ManageGroupUserPermissions.tsx @@ -1,12 +1,12 @@ import React, { FC, memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat, ApiChatBannedRights } from '../../../api/types'; import { ManagementScreens } from '../../../types'; -import { selectChat } from '../../../modules/selectors'; +import { selectChat } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/right/management/ManageGroupUserPermissionsCreate.tsx b/src/components/right/management/ManageGroupUserPermissionsCreate.tsx index d2fbe9ac3..1fcf361a7 100644 --- a/src/components/right/management/ManageGroupUserPermissionsCreate.tsx +++ b/src/components/right/management/ManageGroupUserPermissionsCreate.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useCallback, useMemo, } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../modules'; +import { withGlobal } from '../../../global'; import { ApiChatMember, ApiUser, ApiUserStatus } from '../../../api/types'; import { ManagementScreens } from '../../../types'; -import { selectChat } from '../../../modules/selectors'; -import { sortUserIds, isChatChannel } from '../../../modules/helpers'; +import { selectChat } from '../../../global/selectors'; +import { sortUserIds, isChatChannel } from '../../../global/helpers'; import useHistoryBack from '../../../hooks/useHistoryBack'; import PrivateChatInfo from '../../common/PrivateChatInfo'; diff --git a/src/components/right/management/ManageInvite.tsx b/src/components/right/management/ManageInvite.tsx index 6a57f9fb0..5e325fc22 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; 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 ad2a6abab..7b930b948 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChatInviteImporter, ApiExportedInvite, ApiUser } from '../../../api/types'; @@ -10,8 +10,8 @@ import useLang from '../../../hooks/useLang'; import { copyTextToClipboard } from '../../../util/clipboard'; import { getServerTime } from '../../../util/serverTime'; import { formatFullDate, formatMediaDateTime, formatTime } from '../../../util/dateFormat'; -import { isChatChannel } from '../../../modules/helpers'; -import { selectChat } from '../../../modules/selectors'; +import { isChatChannel } from '../../../global/helpers'; +import { selectChat } from '../../../global/selectors'; import PrivateChatInfo from '../../common/PrivateChatInfo'; import ListItem from '../../ui/ListItem'; diff --git a/src/components/right/management/ManageInvites.tsx b/src/components/right/management/ManageInvites.tsx index a76285f19..293b43cdf 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 { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat, ApiExportedInvite } from '../../../api/types'; import { ManagementScreens } from '../../../types'; @@ -13,12 +13,12 @@ import useLang from '../../../hooks/useLang'; import { formatCountdown, MILLISECONDS_IN_DAY } from '../../../util/dateFormat'; import useInterval from '../../../hooks/useInterval'; import useForceUpdate from '../../../hooks/useForceUpdate'; -import { selectChat } from '../../../modules/selectors'; +import { selectChat } from '../../../global/selectors'; import { copyTextToClipboard } from '../../../util/clipboard'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; import { getServerTime } from '../../../util/serverTime'; import useFlag from '../../../hooks/useFlag'; -import { isChatChannel } from '../../../modules/helpers'; +import { isChatChannel } from '../../../global/helpers'; import ListItem from '../../ui/ListItem'; import NothingFound from '../../common/NothingFound'; diff --git a/src/components/right/management/ManageJoinRequests.tsx b/src/components/right/management/ManageJoinRequests.tsx index 809ee297e..10ff3603d 100644 --- a/src/components/right/management/ManageJoinRequests.tsx +++ b/src/components/right/management/ManageJoinRequests.tsx @@ -1,14 +1,14 @@ import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiChat } from '../../../api/types'; import { STICKER_SIZE_JOIN_REQUESTS } from '../../../config'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import { selectChat } from '../../../modules/selectors'; -import { isChatChannel, isUserId } from '../../../modules/helpers'; +import { selectChat } from '../../../global/selectors'; +import { isChatChannel, isUserId } from '../../../global/helpers'; import useLang from '../../../hooks/useLang'; import useFlag from '../../../hooks/useFlag'; import getAnimationData from '../../common/helpers/animatedAssets'; diff --git a/src/components/right/management/ManageReactions.tsx b/src/components/right/management/ManageReactions.tsx index 145757002..0b879764b 100644 --- a/src/components/right/management/ManageReactions.tsx +++ b/src/components/right/management/ManageReactions.tsx @@ -1,11 +1,11 @@ import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiAvailableReaction, ApiChat } from '../../../api/types'; -import { selectChat } from '../../../modules/selectors'; +import { selectChat } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/right/management/ManageUser.tsx b/src/components/right/management/ManageUser.tsx index 708fc205e..50b128c5e 100644 --- a/src/components/right/management/ManageUser.tsx +++ b/src/components/right/management/ManageUser.tsx @@ -2,15 +2,15 @@ import { ChangeEvent } from 'react'; import React, { FC, memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { ApiUser } from '../../../api/types'; import { ManagementProgress } from '../../../types'; import { selectChat, selectNotifyExceptions, selectNotifySettings, selectUser, -} from '../../../modules/selectors'; -import { selectIsChatMuted } from '../../../modules/helpers'; +} from '../../../global/selectors'; +import { selectIsChatMuted } from '../../../global/helpers'; import useFlag from '../../../hooks/useFlag'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/right/management/Management.tsx b/src/components/right/management/Management.tsx index 7fd5d3ba2..d54fc1682 100644 --- a/src/components/right/management/Management.tsx +++ b/src/components/right/management/Management.tsx @@ -1,9 +1,9 @@ import React, { FC, memo } from '../../../lib/teact/teact'; -import { withGlobal } from '../../../modules'; +import { withGlobal } from '../../../global'; import { ManagementScreens, ManagementType } from '../../../types'; -import { selectCurrentManagementType } from '../../../modules/selectors'; +import { selectCurrentManagementType } from '../../../global/selectors'; import ManageUser from './ManageUser'; import ManageGroup from './ManageGroup'; diff --git a/src/components/right/management/RemoveGroupUserModal.tsx b/src/components/right/management/RemoveGroupUserModal.tsx index 6720487be..fcf483eeb 100644 --- a/src/components/right/management/RemoveGroupUserModal.tsx +++ b/src/components/right/management/RemoveGroupUserModal.tsx @@ -1,11 +1,11 @@ import React, { FC, useMemo, useState, memo, useRef, useCallback, } from '../../../lib/teact/teact'; -import { getActions, getGlobal, withGlobal } from '../../../modules'; +import { getActions, getGlobal, withGlobal } from '../../../global'; import { ApiChat } from '../../../api/types'; -import { filterUsersByName } from '../../../modules/helpers'; +import { filterUsersByName } from '../../../global/helpers'; import useLang from '../../../hooks/useLang'; import ChatOrUserPicker from '../../common/ChatOrUserPicker'; diff --git a/src/components/right/statistics/Statistics.tsx b/src/components/right/statistics/Statistics.tsx index 50fb2a8dd..4320e69da 100644 --- a/src/components/right/statistics/Statistics.tsx +++ b/src/components/right/statistics/Statistics.tsx @@ -1,13 +1,13 @@ import React, { FC, memo, useState, useEffect, useRef, } from '../../../lib/teact/teact'; -import { getActions, withGlobal } from '../../../modules'; +import { getActions, withGlobal } from '../../../global'; import { callApi } from '../../../api/gramjs'; import { ApiMessage, ApiStatistics, StatisticsRecentMessage as StatisticsRecentMessageType, StatisticsGraph, } from '../../../api/types'; -import { selectChat, selectStatistics } from '../../../modules/selectors'; +import { selectChat, selectStatistics } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/right/statistics/StatisticsRecentMessage.tsx b/src/components/right/statistics/StatisticsRecentMessage.tsx index 4d025ff61..7cdf52aa2 100644 --- a/src/components/right/statistics/StatisticsRecentMessage.tsx +++ b/src/components/right/statistics/StatisticsRecentMessage.tsx @@ -11,7 +11,7 @@ import { getMessageMediaThumbDataUri, getMessageVideo, getMessageRoundVideo, -} from '../../../modules/helpers'; +} from '../../../global/helpers'; import { renderMessageSummary } from '../../common/helpers/renderMessageText'; import useMedia from '../../../hooks/useMedia'; diff --git a/src/components/test/ErrorTest.tsx b/src/components/test/ErrorTest.tsx index d97f0441a..aad436771 100644 --- a/src/components/test/ErrorTest.tsx +++ b/src/components/test/ErrorTest.tsx @@ -1,5 +1,5 @@ import React, { FC } from '../../lib/teact/teact'; -import { withGlobal } from '../../modules'; +import { withGlobal } from '../../global'; type OwnProps = { parentRand: number; diff --git a/src/components/test/Test.tsx b/src/components/test/Test.tsx index ed0dc47b9..afd7751a6 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 '../../modules'; +import { withGlobal } from '../../global'; import { GlobalState } from '../../global/types'; import SubTest from './SubTest'; diff --git a/src/components/test/TestNoRedundancy.tsx b/src/components/test/TestNoRedundancy.tsx index be2628aef..ab41aec06 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 '../../modules'; +import { getGlobal, setGlobal, withGlobal } from '../../global'; import { GlobalState } from '../../global/types'; document.ondblclick = () => { diff --git a/src/components/ui/Transition.tsx b/src/components/ui/Transition.tsx index 94072737f..aedb58dca 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 '../../modules'; +import { getGlobal } from '../../global'; import { GlobalState } from '../../global/types'; import { ANIMATION_LEVEL_MIN } from '../../config'; diff --git a/src/modules/actions/all.ts b/src/global/actions/all.ts similarity index 100% rename from src/modules/actions/all.ts rename to src/global/actions/all.ts diff --git a/src/modules/actions/api/bots.ts b/src/global/actions/api/bots.ts similarity index 99% rename from src/modules/actions/api/bots.ts rename to src/global/actions/api/bots.ts index 2be298f99..5fc3dcd6a 100644 --- a/src/modules/actions/api/bots.ts +++ b/src/global/actions/api/bots.ts @@ -1,6 +1,6 @@ import { addActionHandler, getActions, getGlobal, setGlobal, -} from '../..'; +} from '../../index'; import { ApiChat, ApiContact, ApiUser } from '../../../api/types'; import { InlineBotSettings } from '../../../types'; diff --git a/src/modules/actions/api/calls.async.ts b/src/global/actions/api/calls.async.ts similarity index 99% rename from src/modules/actions/api/calls.async.ts rename to src/global/actions/api/calls.async.ts index 4e7c4bb72..0953d2280 100644 --- a/src/modules/actions/api/calls.async.ts +++ b/src/global/actions/api/calls.async.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { joinGroupCall, startSharingScreen, diff --git a/src/modules/actions/api/chats.ts b/src/global/actions/api/chats.ts similarity index 99% rename from src/modules/actions/api/chats.ts rename to src/global/actions/api/chats.ts index 0895bcb26..6bc643ca4 100644 --- a/src/modules/actions/api/chats.ts +++ b/src/global/actions/api/chats.ts @@ -1,12 +1,12 @@ import { addActionHandler, getActions, getGlobal, setGlobal, -} from '../..'; +} from '../../index'; import { ApiChat, ApiUser, ApiChatFolder, MAIN_THREAD_ID, } from '../../../api/types'; import { NewChatMembersProgress, ChatCreationProgress, ManagementProgress } from '../../../types'; -import { GlobalActions } from '../../../global/types'; +import { GlobalActions } from '../../types'; import { ARCHIVED_FOLDER_ID, @@ -544,7 +544,7 @@ addActionHandler('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/global/actions/api/globalSearch.ts similarity index 98% rename from src/modules/actions/api/globalSearch.ts rename to src/global/actions/api/globalSearch.ts index db603b8a9..99c360a52 100644 --- a/src/modules/actions/api/globalSearch.ts +++ b/src/global/actions/api/globalSearch.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { callApi } from '../../../api/gramjs'; import { ApiChat, ApiGlobalMessageSearchType } from '../../../api/types'; diff --git a/src/modules/actions/api/initial.ts b/src/global/actions/api/initial.ts similarity index 98% rename from src/modules/actions/api/initial.ts rename to src/global/actions/api/initial.ts index 2800d956c..d511c41cb 100644 --- a/src/modules/actions/api/initial.ts +++ b/src/global/actions/api/initial.ts @@ -1,9 +1,9 @@ import { addActionHandler, getActions, getGlobal, setGlobal, -} from '../..'; +} from '../../index'; import { initApi, callApi } from '../../../api/gramjs'; -import { GlobalState } from '../../../global/types'; +import { GlobalState } from '../../types'; import { LANG_CACHE_NAME, diff --git a/src/modules/actions/api/localSearch.ts b/src/global/actions/api/localSearch.ts similarity index 99% rename from src/modules/actions/api/localSearch.ts rename to src/global/actions/api/localSearch.ts index 24bca1e56..a30001357 100644 --- a/src/modules/actions/api/localSearch.ts +++ b/src/global/actions/api/localSearch.ts @@ -1,6 +1,6 @@ import { addActionHandler, getActions, getGlobal, setGlobal, -} from '../..'; +} from '../../index'; import { ApiChat, MAIN_THREAD_ID } from '../../../api/types'; diff --git a/src/modules/actions/api/management.ts b/src/global/actions/api/management.ts similarity index 99% rename from src/modules/actions/api/management.ts rename to src/global/actions/api/management.ts index 3e344b719..916315e1a 100644 --- a/src/modules/actions/api/management.ts +++ b/src/global/actions/api/management.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { ManagementProgress } from '../../../types'; import { callApi } from '../../../api/gramjs'; diff --git a/src/modules/actions/api/messages.ts b/src/global/actions/api/messages.ts similarity index 99% rename from src/modules/actions/api/messages.ts rename to src/global/actions/api/messages.ts index f71a848a1..338de5f1e 100644 --- a/src/modules/actions/api/messages.ts +++ b/src/global/actions/api/messages.ts @@ -1,6 +1,6 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; -import { GlobalActions } from '../../../global/types'; +import { GlobalActions } from '../../types'; import { ApiAttachment, ApiChat, diff --git a/src/modules/actions/api/payments.ts b/src/global/actions/api/payments.ts similarity index 99% rename from src/modules/actions/api/payments.ts rename to src/global/actions/api/payments.ts index 7da4cffe4..b3c7c8574 100644 --- a/src/modules/actions/api/payments.ts +++ b/src/global/actions/api/payments.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { PaymentStep } from '../../../types'; import { ApiChat } from '../../../api/types'; diff --git a/src/modules/actions/api/reactions.ts b/src/global/actions/api/reactions.ts similarity index 99% rename from src/modules/actions/api/reactions.ts rename to src/global/actions/api/reactions.ts index 59c20dcdd..d333a435a 100644 --- a/src/modules/actions/api/reactions.ts +++ b/src/global/actions/api/reactions.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; 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/global/actions/api/settings.ts similarity index 99% rename from src/modules/actions/api/settings.ts rename to src/global/actions/api/settings.ts index 7b4ae08fc..01fa8afea 100644 --- a/src/modules/actions/api/settings.ts +++ b/src/global/actions/api/settings.ts @@ -1,6 +1,6 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; -import { GlobalState } from '../../../global/types'; +import { GlobalState } from '../../types'; import { ApiPrivacyKey, PrivacyVisibility, ProfileEditProgress, InputPrivacyRules, InputPrivacyContact, UPLOADING_WALLPAPER_SLUG, diff --git a/src/modules/actions/api/statistics.ts b/src/global/actions/api/statistics.ts similarity index 95% rename from src/modules/actions/api/statistics.ts rename to src/global/actions/api/statistics.ts index 9c47e6d79..adfc00425 100644 --- a/src/modules/actions/api/statistics.ts +++ b/src/global/actions/api/statistics.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { callApi } from '../../../api/gramjs'; import { updateStatistics, updateStatisticsGraph } from '../../reducers'; diff --git a/src/modules/actions/api/symbols.ts b/src/global/actions/api/symbols.ts similarity index 99% rename from src/modules/actions/api/symbols.ts rename to src/global/actions/api/symbols.ts index cc412435e..f2c956371 100644 --- a/src/modules/actions/api/symbols.ts +++ b/src/global/actions/api/symbols.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { ApiSticker } from '../../../api/types'; import { LangCode } from '../../../types'; diff --git a/src/modules/actions/api/sync.ts b/src/global/actions/api/sync.ts similarity index 99% rename from src/modules/actions/api/sync.ts rename to src/global/actions/api/sync.ts index a1e8c010e..9d4dda3ba 100644 --- a/src/modules/actions/api/sync.ts +++ b/src/global/actions/api/sync.ts @@ -1,6 +1,6 @@ import { addActionHandler, getGlobal, setGlobal, getActions, -} from '../..'; +} from '../../index'; import { ApiChat, ApiFormattedText, ApiMessage, MAIN_THREAD_ID, diff --git a/src/modules/actions/api/twoFaSettings.ts b/src/global/actions/api/twoFaSettings.ts similarity index 97% rename from src/modules/actions/api/twoFaSettings.ts rename to src/global/actions/api/twoFaSettings.ts index 382eb3be9..26c714026 100644 --- a/src/modules/actions/api/twoFaSettings.ts +++ b/src/global/actions/api/twoFaSettings.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { callApi } from '../../../api/gramjs'; import { replaceSettings, updateTwoFaSettings } from '../../reducers'; diff --git a/src/modules/actions/api/users.ts b/src/global/actions/api/users.ts similarity index 99% rename from src/modules/actions/api/users.ts rename to src/global/actions/api/users.ts index 425f271aa..1516d6338 100644 --- a/src/modules/actions/api/users.ts +++ b/src/global/actions/api/users.ts @@ -1,6 +1,6 @@ import { addActionHandler, getActions, getGlobal, setGlobal, -} from '../..'; +} from '../../index'; import { ApiUser } from '../../../api/types'; import { ManagementProgress } from '../../../types'; diff --git a/src/modules/actions/apiUpdaters/calls.ts b/src/global/actions/apiUpdaters/calls.ts similarity index 96% rename from src/modules/actions/apiUpdaters/calls.ts rename to src/global/actions/apiUpdaters/calls.ts index 4d09a4e5b..7891232ae 100644 --- a/src/modules/actions/apiUpdaters/calls.ts +++ b/src/global/actions/apiUpdaters/calls.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal } from '../..'; +import { addActionHandler, getGlobal } from '../../index'; import { removeGroupCall, updateGroupCall, updateGroupCallParticipant } from '../../reducers/calls'; import { omit } from '../../../util/iteratees'; import { selectChat } from '../../selectors'; diff --git a/src/modules/actions/apiUpdaters/chats.ts b/src/global/actions/apiUpdaters/chats.ts similarity index 99% rename from src/modules/actions/apiUpdaters/chats.ts rename to src/global/actions/apiUpdaters/chats.ts index 082769e98..2b36fdba0 100644 --- a/src/modules/actions/apiUpdaters/chats.ts +++ b/src/global/actions/apiUpdaters/chats.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { ApiUpdate, MAIN_THREAD_ID } from '../../../api/types'; diff --git a/src/modules/actions/apiUpdaters/initial.ts b/src/global/actions/apiUpdaters/initial.ts similarity index 98% rename from src/modules/actions/apiUpdaters/initial.ts rename to src/global/actions/apiUpdaters/initial.ts index 00c78f159..5d3c56965 100644 --- a/src/modules/actions/apiUpdaters/initial.ts +++ b/src/global/actions/apiUpdaters/initial.ts @@ -1,8 +1,8 @@ import { addActionHandler, getActions, getGlobal, setGlobal, -} from '../..'; +} from '../../index'; -import { GlobalState } from '../../../global/types'; +import { GlobalState } from '../../types'; import { ApiUpdate, diff --git a/src/modules/actions/apiUpdaters/messages.ts b/src/global/actions/apiUpdaters/messages.ts similarity index 99% rename from src/modules/actions/apiUpdaters/messages.ts rename to src/global/actions/apiUpdaters/messages.ts index 67bcd8804..ee3b557ae 100644 --- a/src/modules/actions/apiUpdaters/messages.ts +++ b/src/global/actions/apiUpdaters/messages.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { ApiUpdate, ApiMessage, ApiPollResult, ApiThreadInfo, MAIN_THREAD_ID, @@ -20,7 +20,7 @@ import { deleteChatScheduledMessages, updateThreadUnreadFromForwardedMessage, } from '../../reducers'; -import { ActiveEmojiInteraction, GlobalActions, GlobalState } from '../../../global/types'; +import { ActiveEmojiInteraction, GlobalActions, GlobalState } from '../../types'; import { selectChatMessage, selectChatMessages, diff --git a/src/modules/actions/apiUpdaters/misc.ts b/src/global/actions/apiUpdaters/misc.ts similarity index 94% rename from src/modules/actions/apiUpdaters/misc.ts rename to src/global/actions/apiUpdaters/misc.ts index 55a3fe3d1..a3a04b92a 100644 --- a/src/modules/actions/apiUpdaters/misc.ts +++ b/src/global/actions/apiUpdaters/misc.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { ApiUpdate } from '../../../api/types'; import { ApiPrivacyKey, PaymentStep } from '../../../types'; diff --git a/src/modules/actions/apiUpdaters/payments.ts b/src/global/actions/apiUpdaters/payments.ts similarity index 86% rename from src/modules/actions/apiUpdaters/payments.ts rename to src/global/actions/apiUpdaters/payments.ts index 30b040a86..0ff279172 100644 --- a/src/modules/actions/apiUpdaters/payments.ts +++ b/src/global/actions/apiUpdaters/payments.ts @@ -1,4 +1,4 @@ -import { addActionHandler } from '../..'; +import { addActionHandler } from '../../index'; import { ApiUpdate } from '../../../api/types'; diff --git a/src/modules/actions/apiUpdaters/settings.ts b/src/global/actions/apiUpdaters/settings.ts similarity index 88% rename from src/modules/actions/apiUpdaters/settings.ts rename to src/global/actions/apiUpdaters/settings.ts index 994c39cc9..9153d398a 100644 --- a/src/modules/actions/apiUpdaters/settings.ts +++ b/src/global/actions/apiUpdaters/settings.ts @@ -1,7 +1,7 @@ -import { addActionHandler, setGlobal } from '../..'; +import { addActionHandler, setGlobal } from '../../index'; import { ApiUpdate } from '../../../api/types'; -import { GlobalState } from '../../../global/types'; +import { GlobalState } from '../../types'; import { addNotifyException, updateChat, updateNotifySettings } from '../../reducers'; addActionHandler('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => { diff --git a/src/modules/actions/apiUpdaters/symbols.ts b/src/global/actions/apiUpdaters/symbols.ts similarity index 87% rename from src/modules/actions/apiUpdaters/symbols.ts rename to src/global/actions/apiUpdaters/symbols.ts index 047801f65..3deae0ae6 100644 --- a/src/modules/actions/apiUpdaters/symbols.ts +++ b/src/global/actions/apiUpdaters/symbols.ts @@ -1,4 +1,4 @@ -import { addActionHandler } from '../..'; +import { addActionHandler } from '../../index'; import { ApiUpdate } from '../../../api/types'; diff --git a/src/modules/actions/apiUpdaters/twoFaSettings.ts b/src/global/actions/apiUpdaters/twoFaSettings.ts similarity index 86% rename from src/modules/actions/apiUpdaters/twoFaSettings.ts rename to src/global/actions/apiUpdaters/twoFaSettings.ts index e5e11650b..345266ea4 100644 --- a/src/modules/actions/apiUpdaters/twoFaSettings.ts +++ b/src/global/actions/apiUpdaters/twoFaSettings.ts @@ -1,7 +1,7 @@ -import { addActionHandler } from '../..'; +import { addActionHandler } from '../../index'; import { ApiUpdate } from '../../../api/types'; -import { GlobalState } from '../../../global/types'; +import { GlobalState } from '../../types'; addActionHandler('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => { switch (update['@type']) { diff --git a/src/modules/actions/apiUpdaters/users.ts b/src/global/actions/apiUpdaters/users.ts similarity index 95% rename from src/modules/actions/apiUpdaters/users.ts rename to src/global/actions/apiUpdaters/users.ts index b1366821c..c4ee741df 100644 --- a/src/modules/actions/apiUpdaters/users.ts +++ b/src/global/actions/apiUpdaters/users.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { ApiUpdate, ApiUserStatus } from '../../../api/types'; diff --git a/src/modules/actions/calls.ts b/src/global/actions/calls.ts similarity index 100% rename from src/modules/actions/calls.ts rename to src/global/actions/calls.ts diff --git a/src/modules/actions/initial.ts b/src/global/actions/initial.ts similarity index 100% rename from src/modules/actions/initial.ts rename to src/global/actions/initial.ts diff --git a/src/modules/actions/ui/calls.ts b/src/global/actions/ui/calls.ts similarity index 99% rename from src/modules/actions/ui/calls.ts rename to src/global/actions/ui/calls.ts index c3b3cb7e4..de8f30cf9 100644 --- a/src/modules/actions/ui/calls.ts +++ b/src/global/actions/ui/calls.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; 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/global/actions/ui/chats.ts similarity index 97% rename from src/modules/actions/ui/chats.ts rename to src/global/actions/ui/chats.ts index cced0991b..5b0b700b6 100644 --- a/src/modules/actions/ui/chats.ts +++ b/src/global/actions/ui/chats.ts @@ -1,4 +1,4 @@ -import { addActionHandler, setGlobal } from '../..'; +import { addActionHandler, setGlobal } from '../../index'; import { exitMessageSelectMode, replaceThreadParam, updateCurrentMessageList, diff --git a/src/modules/actions/ui/globalSearch.ts b/src/global/actions/ui/globalSearch.ts similarity index 96% rename from src/modules/actions/ui/globalSearch.ts rename to src/global/actions/ui/globalSearch.ts index 787ccebc9..f1e180725 100644 --- a/src/modules/actions/ui/globalSearch.ts +++ b/src/global/actions/ui/globalSearch.ts @@ -1,4 +1,4 @@ -import { addActionHandler } from '../..'; +import { addActionHandler } from '../../index'; import { updateGlobalSearch, updateGlobalSearchContent } from '../../reducers'; diff --git a/src/modules/actions/ui/initial.ts b/src/global/actions/ui/initial.ts similarity index 98% rename from src/modules/actions/ui/initial.ts rename to src/global/actions/ui/initial.ts index 39352ec85..ba6ae8f9e 100644 --- a/src/modules/actions/ui/initial.ts +++ b/src/global/actions/ui/initial.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { ANIMATION_LEVEL_MAX } from '../../../config'; import { diff --git a/src/modules/actions/ui/localSearch.ts b/src/global/actions/ui/localSearch.ts similarity index 95% rename from src/modules/actions/ui/localSearch.ts rename to src/global/actions/ui/localSearch.ts index 6cc31db1c..7e8e0c759 100644 --- a/src/modules/actions/ui/localSearch.ts +++ b/src/global/actions/ui/localSearch.ts @@ -1,4 +1,4 @@ -import { addActionHandler } from '../..'; +import { addActionHandler } from '../../index'; import { updateLocalTextSearch, @@ -8,7 +8,7 @@ import { import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; import { selectCurrentMessageList } from '../../selectors'; import { buildChatThreadKey } from '../../helpers'; -import { GlobalState } from '../../../global/types'; +import { GlobalState } from '../../types'; addActionHandler('openLocalTextSearch', (global) => { const { chatId, threadId } = selectCurrentMessageList(global) || {}; diff --git a/src/modules/actions/ui/messages.ts b/src/global/actions/ui/messages.ts similarity index 99% rename from src/modules/actions/ui/messages.ts rename to src/global/actions/ui/messages.ts index a7e1e0f72..92449b3cb 100644 --- a/src/modules/actions/ui/messages.ts +++ b/src/global/actions/ui/messages.ts @@ -1,4 +1,4 @@ -import { addActionHandler, getGlobal, setGlobal } from '../..'; +import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { ApiMessage, MAIN_THREAD_ID } from '../../../api/types'; import { FocusDirection } from '../../../types'; @@ -42,7 +42,7 @@ import parseMessageInput from '../../../util/parseMessageInput'; import { getMessageSummaryText, getSenderTitle } from '../../helpers'; import * as langProvider from '../../../util/langProvider'; import { copyTextToClipboard } from '../../../util/clipboard'; -import { GlobalState } from '../../../global/types'; +import { GlobalState } from '../../types'; const FOCUS_DURATION = 1500; const FOCUS_NO_HIGHLIGHT_DURATION = FAST_SMOOTH_MAX_DURATION + ANIMATION_END_DELAY; diff --git a/src/modules/actions/ui/misc.ts b/src/global/actions/ui/misc.ts similarity index 98% rename from src/modules/actions/ui/misc.ts rename to src/global/actions/ui/misc.ts index c636c4ae3..296f2d493 100644 --- a/src/modules/actions/ui/misc.ts +++ b/src/global/actions/ui/misc.ts @@ -1,6 +1,6 @@ -import { addActionHandler } from '../..'; +import { addActionHandler } from '../../index'; -import { GlobalState } from '../../../global/types'; +import { GlobalState } from '../../types'; import { ApiError } from '../../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../../util/environment'; diff --git a/src/modules/actions/ui/payments.ts b/src/global/actions/ui/payments.ts similarity index 93% rename from src/modules/actions/ui/payments.ts rename to src/global/actions/ui/payments.ts index 425705f9f..6cc676888 100644 --- a/src/modules/actions/ui/payments.ts +++ b/src/global/actions/ui/payments.ts @@ -1,4 +1,4 @@ -import { addActionHandler } from '../..'; +import { addActionHandler } from '../../index'; import { clearPayment, closeInvoice } from '../../reducers'; diff --git a/src/modules/actions/ui/settings.ts b/src/global/actions/ui/settings.ts similarity index 91% rename from src/modules/actions/ui/settings.ts rename to src/global/actions/ui/settings.ts index 79e14a5d0..0233b9b12 100644 --- a/src/modules/actions/ui/settings.ts +++ b/src/global/actions/ui/settings.ts @@ -1,4 +1,4 @@ -import { addActionHandler } from '../..'; +import { addActionHandler } from '../../index'; import { ISettings, IThemeSettings, ThemeKey } from '../../../types'; import { replaceSettings, replaceThemeSettings } from '../../reducers'; diff --git a/src/modules/actions/ui/stickerSearch.ts b/src/global/actions/ui/stickerSearch.ts similarity index 91% rename from src/modules/actions/ui/stickerSearch.ts rename to src/global/actions/ui/stickerSearch.ts index 8b0a231b7..11cf18182 100644 --- a/src/modules/actions/ui/stickerSearch.ts +++ b/src/global/actions/ui/stickerSearch.ts @@ -1,4 +1,4 @@ -import { addActionHandler } from '../..'; +import { addActionHandler } from '../../index'; addActionHandler('setStickerSearchQuery', (global, actions, payload) => { const { query } = payload!; diff --git a/src/modules/actions/ui/users.ts b/src/global/actions/ui/users.ts similarity index 86% rename from src/modules/actions/ui/users.ts rename to src/global/actions/ui/users.ts index 1bf5945e8..2da52270f 100644 --- a/src/modules/actions/ui/users.ts +++ b/src/global/actions/ui/users.ts @@ -1,4 +1,4 @@ -import { addActionHandler } from '../..'; +import { addActionHandler } from '../../index'; import { updateUserSearch } from '../../reducers'; diff --git a/src/global/cache.ts b/src/global/cache.ts index 7bead81b6..af09c1346 100644 --- a/src/global/cache.ts +++ b/src/global/cache.ts @@ -1,6 +1,6 @@ import { addCallback, removeCallback } from '../lib/teact/teactn'; -import { addActionHandler, getGlobal } from '../modules'; +import { addActionHandler, getGlobal } from './index'; import { GlobalState } from './types'; import { MAIN_THREAD_ID } from '../api/types'; @@ -26,11 +26,11 @@ import { selectCurrentChat, selectCurrentMessageList, selectVisibleUsers, -} from '../modules/selectors'; +} from './selectors'; import { hasStoredSession } from '../util/sessions'; -import { INITIAL_STATE } from './initial'; +import { INITIAL_STATE } from './initialState'; import { parseLocationHash } from '../util/routing'; -import { isUserId } from '../modules/helpers'; +import { isUserId } from './helpers'; import { getOrderedIds } from '../util/folderManager'; const UPDATE_THROTTLE = 5000; diff --git a/src/modules/helpers/chats.ts b/src/global/helpers/chats.ts similarity index 100% rename from src/modules/helpers/chats.ts rename to src/global/helpers/chats.ts diff --git a/src/modules/helpers/index.ts b/src/global/helpers/index.ts similarity index 100% rename from src/modules/helpers/index.ts rename to src/global/helpers/index.ts diff --git a/src/modules/helpers/localSearch.ts b/src/global/helpers/localSearch.ts similarity index 100% rename from src/modules/helpers/localSearch.ts rename to src/global/helpers/localSearch.ts diff --git a/src/modules/helpers/messageMedia.ts b/src/global/helpers/messageMedia.ts similarity index 100% rename from src/modules/helpers/messageMedia.ts rename to src/global/helpers/messageMedia.ts diff --git a/src/modules/helpers/messageSummary.ts b/src/global/helpers/messageSummary.ts similarity index 100% rename from src/modules/helpers/messageSummary.ts rename to src/global/helpers/messageSummary.ts diff --git a/src/modules/helpers/messages.ts b/src/global/helpers/messages.ts similarity index 100% rename from src/modules/helpers/messages.ts rename to src/global/helpers/messages.ts diff --git a/src/modules/helpers/payments.ts b/src/global/helpers/payments.ts similarity index 100% rename from src/modules/helpers/payments.ts rename to src/global/helpers/payments.ts diff --git a/src/modules/helpers/reactions.ts b/src/global/helpers/reactions.ts similarity index 100% rename from src/modules/helpers/reactions.ts rename to src/global/helpers/reactions.ts diff --git a/src/modules/helpers/users.ts b/src/global/helpers/users.ts similarity index 100% rename from src/modules/helpers/users.ts rename to src/global/helpers/users.ts diff --git a/src/global/index.ts b/src/global/index.ts index 6a5241173..c80ecaad7 100644 --- a/src/global/index.ts +++ b/src/global/index.ts @@ -1,12 +1,10 @@ -import { addActionHandler } from '../modules'; +import { typify } from '../lib/teact/teactn'; +import { GlobalState, ActionPayloads, NonTypedActionNames } from './types'; -import { INITIAL_STATE } from './initial'; -import { initCache, loadCache } from './cache'; -import { cloneDeep } from '../util/iteratees'; +const typed = typify(); -initCache(); - -addActionHandler('init', () => { - const initial = cloneDeep(INITIAL_STATE); - return loadCache(initial) || initial; -}); +export const getGlobal = typed.getGlobal; +export const setGlobal = typed.setGlobal; +export const getActions = typed.getActions; +export const addActionHandler = typed.addActionHandler; +export const withGlobal = typed.withGlobal; diff --git a/src/global/init.ts b/src/global/init.ts new file mode 100644 index 000000000..cad5c2092 --- /dev/null +++ b/src/global/init.ts @@ -0,0 +1,12 @@ +import { addActionHandler } from './index'; + +import { INITIAL_STATE } from './initialState'; +import { initCache, loadCache } from './cache'; +import { cloneDeep } from '../util/iteratees'; + +initCache(); + +addActionHandler('init', () => { + const initial = cloneDeep(INITIAL_STATE); + return loadCache(initial) || initial; +}); diff --git a/src/global/initial.ts b/src/global/initialState.ts similarity index 100% rename from src/global/initial.ts rename to src/global/initialState.ts diff --git a/src/modules/reducers/bots.ts b/src/global/reducers/bots.ts similarity index 92% rename from src/modules/reducers/bots.ts rename to src/global/reducers/bots.ts index ac4f8e9b0..dea7d3ab6 100644 --- a/src/modules/reducers/bots.ts +++ b/src/global/reducers/bots.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { InlineBotSettings } from '../../types'; export function replaceInlineBotSettings( diff --git a/src/modules/reducers/calls.ts b/src/global/reducers/calls.ts similarity index 98% rename from src/modules/reducers/calls.ts rename to src/global/reducers/calls.ts index 41250737f..ccec8b7ac 100644 --- a/src/modules/reducers/calls.ts +++ b/src/global/reducers/calls.ts @@ -1,5 +1,5 @@ import { GroupCallParticipant } from '../../lib/secret-sauce'; -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ApiGroupCall } from '../../api/types'; import { selectGroupCall } from '../selectors/calls'; import { omit } from '../../util/iteratees'; diff --git a/src/modules/reducers/chats.ts b/src/global/reducers/chats.ts similarity index 99% rename from src/modules/reducers/chats.ts rename to src/global/reducers/chats.ts index e6916606b..2b1f3c6c8 100644 --- a/src/modules/reducers/chats.ts +++ b/src/global/reducers/chats.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ApiChat, ApiChatMember, ApiPhoto } from '../../api/types'; import { ARCHIVED_FOLDER_ID } from '../../config'; diff --git a/src/modules/reducers/globalSearch.ts b/src/global/reducers/globalSearch.ts similarity index 97% rename from src/modules/reducers/globalSearch.ts rename to src/global/reducers/globalSearch.ts index ce39c42b6..2c5b50608 100644 --- a/src/modules/reducers/globalSearch.ts +++ b/src/global/reducers/globalSearch.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { GlobalSearchContent } from '../../types'; import { ApiGlobalMessageSearchType, ApiMessage } from '../../api/types'; import { areSortedArraysEqual } from '../../util/iteratees'; diff --git a/src/modules/reducers/index.ts b/src/global/reducers/index.ts similarity index 100% rename from src/modules/reducers/index.ts rename to src/global/reducers/index.ts diff --git a/src/modules/reducers/localSearch.ts b/src/global/reducers/localSearch.ts similarity index 98% rename from src/modules/reducers/localSearch.ts rename to src/global/reducers/localSearch.ts index 5f0a6b46c..94801005a 100644 --- a/src/modules/reducers/localSearch.ts +++ b/src/global/reducers/localSearch.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ApiMessageSearchType } from '../../api/types'; import { areSortedArraysEqual, unique } from '../../util/iteratees'; diff --git a/src/modules/reducers/management.ts b/src/global/reducers/management.ts similarity index 92% rename from src/modules/reducers/management.ts rename to src/global/reducers/management.ts index c68cce33a..1e7f016a5 100644 --- a/src/modules/reducers/management.ts +++ b/src/global/reducers/management.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ManagementProgress, ManagementState } from '../../types'; export function updateManagementProgress(global: GlobalState, progress: ManagementProgress): GlobalState { diff --git a/src/modules/reducers/messages.ts b/src/global/reducers/messages.ts similarity index 99% rename from src/modules/reducers/messages.ts rename to src/global/reducers/messages.ts index 8e327615c..851d5ded1 100644 --- a/src/modules/reducers/messages.ts +++ b/src/global/reducers/messages.ts @@ -1,6 +1,6 @@ import { GlobalState, MessageList, MessageListType, Thread, -} from '../../global/types'; +} from '../types'; import { ApiMessage, ApiSponsoredMessage, ApiThreadInfo, MAIN_THREAD_ID, } from '../../api/types'; diff --git a/src/modules/reducers/payments.ts b/src/global/reducers/payments.ts similarity index 98% rename from src/modules/reducers/payments.ts rename to src/global/reducers/payments.ts index c0ee4361c..23823c4df 100644 --- a/src/modules/reducers/payments.ts +++ b/src/global/reducers/payments.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ShippingOption, PaymentStep } from '../../types'; import { ApiMessage, ApiPaymentForm, ApiReceipt } from '../../api/types'; diff --git a/src/modules/reducers/reactions.ts b/src/global/reducers/reactions.ts similarity index 97% rename from src/modules/reducers/reactions.ts rename to src/global/reducers/reactions.ts index 620d529aa..cc1e1adbe 100644 --- a/src/modules/reducers/reactions.ts +++ b/src/global/reducers/reactions.ts @@ -1,5 +1,5 @@ import { updateChatMessage } from './messages'; -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { selectChatMessage } from '../selectors'; import { MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN, MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN } from '../../config'; import { diff --git a/src/modules/reducers/settings.ts b/src/global/reducers/settings.ts similarity index 98% rename from src/modules/reducers/settings.ts rename to src/global/reducers/settings.ts index 1a207d9ce..17910c051 100644 --- a/src/modules/reducers/settings.ts +++ b/src/global/reducers/settings.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ISettings, IThemeSettings, ThemeKey, NotifyException, } from '../../types'; diff --git a/src/modules/reducers/statistics.ts b/src/global/reducers/statistics.ts similarity index 93% rename from src/modules/reducers/statistics.ts rename to src/global/reducers/statistics.ts index c13dc3948..2fd2a73a7 100644 --- a/src/modules/reducers/statistics.ts +++ b/src/global/reducers/statistics.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ApiStatistics, StatisticsGraph } from '../../api/types'; export function updateStatistics( diff --git a/src/modules/reducers/symbols.ts b/src/global/reducers/symbols.ts similarity index 98% rename from src/modules/reducers/symbols.ts rename to src/global/reducers/symbols.ts index 9f2e824c0..01f2027b9 100644 --- a/src/modules/reducers/symbols.ts +++ b/src/global/reducers/symbols.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ApiSticker, ApiStickerSet, ApiVideo } from '../../api/types'; import { buildCollectionByKey, unique } from '../../util/iteratees'; import { selectStickersForEmoji } from '../selectors'; diff --git a/src/modules/reducers/twoFaSettings.ts b/src/global/reducers/twoFaSettings.ts similarity index 81% rename from src/modules/reducers/twoFaSettings.ts rename to src/global/reducers/twoFaSettings.ts index 54093c87b..380edda8a 100644 --- a/src/modules/reducers/twoFaSettings.ts +++ b/src/global/reducers/twoFaSettings.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; export function updateTwoFaSettings( global: GlobalState, diff --git a/src/modules/reducers/users.ts b/src/global/reducers/users.ts similarity index 99% rename from src/modules/reducers/users.ts rename to src/global/reducers/users.ts index 08c2e1a66..53d116279 100644 --- a/src/modules/reducers/users.ts +++ b/src/global/reducers/users.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ApiUser, ApiUserStatus } from '../../api/types'; import { omit, pick } from '../../util/iteratees'; diff --git a/src/modules/selectors/calls.ts b/src/global/selectors/calls.ts similarity index 96% rename from src/modules/selectors/calls.ts rename to src/global/selectors/calls.ts index 5d6cd8196..c7e2f4c09 100644 --- a/src/modules/selectors/calls.ts +++ b/src/global/selectors/calls.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { selectChat } from './chats'; import { getUserFullName, isChatBasicGroup } from '../helpers'; import { selectUser } from './users'; diff --git a/src/modules/selectors/chats.ts b/src/global/selectors/chats.ts similarity index 99% rename from src/modules/selectors/chats.ts rename to src/global/selectors/chats.ts index aecff17d6..f79507855 100644 --- a/src/modules/selectors/chats.ts +++ b/src/global/selectors/chats.ts @@ -1,5 +1,5 @@ import { ApiChat, MAIN_THREAD_ID } from '../../api/types'; -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { getPrivateChatUserId, isChatChannel, isUserId, isHistoryClearMessage, isUserBot, isUserOnline, diff --git a/src/modules/selectors/globalSearch.ts b/src/global/selectors/globalSearch.ts similarity index 68% rename from src/modules/selectors/globalSearch.ts rename to src/global/selectors/globalSearch.ts index 4cd99670a..a77cfd224 100644 --- a/src/modules/selectors/globalSearch.ts +++ b/src/global/selectors/globalSearch.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; export function selectCurrentGlobalSearchQuery(global: GlobalState) { return global.globalSearch.query; diff --git a/src/modules/selectors/index.ts b/src/global/selectors/index.ts similarity index 100% rename from src/modules/selectors/index.ts rename to src/global/selectors/index.ts diff --git a/src/modules/selectors/localSearch.ts b/src/global/selectors/localSearch.ts similarity index 93% rename from src/modules/selectors/localSearch.ts rename to src/global/selectors/localSearch.ts index 9a98106a0..871aa306d 100644 --- a/src/modules/selectors/localSearch.ts +++ b/src/global/selectors/localSearch.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { selectCurrentMessageList } from './messages'; import { buildChatThreadKey } from '../helpers'; diff --git a/src/modules/selectors/management.ts b/src/global/selectors/management.ts similarity index 95% rename from src/modules/selectors/management.ts rename to src/global/selectors/management.ts index ae9d82991..aa66ba87b 100644 --- a/src/modules/selectors/management.ts +++ b/src/global/selectors/management.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { selectCurrentMessageList } from './messages'; import { selectChat } from './chats'; diff --git a/src/modules/selectors/messages.ts b/src/global/selectors/messages.ts similarity index 99% rename from src/modules/selectors/messages.ts rename to src/global/selectors/messages.ts index 1a729e053..5747ad827 100644 --- a/src/modules/selectors/messages.ts +++ b/src/global/selectors/messages.ts @@ -1,4 +1,4 @@ -import { GlobalState, MessageListType, Thread } from '../../global/types'; +import { GlobalState, MessageListType, Thread } from '../types'; import { ApiChat, ApiMessage, diff --git a/src/modules/selectors/payments.ts b/src/global/selectors/payments.ts similarity index 94% rename from src/modules/selectors/payments.ts rename to src/global/selectors/payments.ts index 868370f03..9377e702b 100644 --- a/src/modules/selectors/payments.ts +++ b/src/global/selectors/payments.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; export function selectPaymentChatId(global: GlobalState) { return global.payment.chatId; diff --git a/src/modules/selectors/settings.ts b/src/global/selectors/settings.ts similarity index 80% rename from src/modules/selectors/settings.ts rename to src/global/selectors/settings.ts index da5cd83cc..4d923378b 100644 --- a/src/modules/selectors/settings.ts +++ b/src/global/selectors/settings.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; export function selectNotifySettings(global: GlobalState) { return global.settings.byKey; diff --git a/src/modules/selectors/statistics.ts b/src/global/selectors/statistics.ts similarity index 91% rename from src/modules/selectors/statistics.ts rename to src/global/selectors/statistics.ts index 425b505ea..5cc5766d5 100644 --- a/src/modules/selectors/statistics.ts +++ b/src/global/selectors/statistics.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { selectCurrentMessageList } from './messages'; import { selectChat } from './chats'; diff --git a/src/modules/selectors/symbols.ts b/src/global/selectors/symbols.ts similarity index 98% rename from src/modules/selectors/symbols.ts rename to src/global/selectors/symbols.ts index 254220de9..2fc8d0046 100644 --- a/src/modules/selectors/symbols.ts +++ b/src/global/selectors/symbols.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ApiSticker } from '../../api/types'; export function selectIsStickerFavorite(global: GlobalState, sticker: ApiSticker) { diff --git a/src/modules/selectors/ui.ts b/src/global/selectors/ui.ts similarity index 97% rename from src/modules/selectors/ui.ts rename to src/global/selectors/ui.ts index bab69dded..4b26d264b 100644 --- a/src/modules/selectors/ui.ts +++ b/src/global/selectors/ui.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { NewChatMembersProgress, RightColumnContent } from '../../types'; import { getSystemTheme, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; diff --git a/src/modules/selectors/users.ts b/src/global/selectors/users.ts similarity index 96% rename from src/modules/selectors/users.ts rename to src/global/selectors/users.ts index 442450bbe..79ece6aef 100644 --- a/src/modules/selectors/users.ts +++ b/src/global/selectors/users.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../../global/types'; +import { GlobalState } from '../types'; import { ApiChat, ApiUser, ApiUserStatus } from '../../api/types'; export function selectUser(global: GlobalState, userId: string): ApiUser | undefined { diff --git a/src/hooks/useAudioPlayer.ts b/src/hooks/useAudioPlayer.ts index 71946e802..008b4dea9 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 { getActions, getGlobal } from '../modules'; +import { getActions, getGlobal } from '../global'; import { register, Track, TrackId } from '../util/audioPlayer'; import useEffectWithPrevDeps from './useEffectWithPrevDeps'; diff --git a/src/hooks/useChatContextActions.ts b/src/hooks/useChatContextActions.ts index 21fed407d..f5334e9ce 100644 --- a/src/hooks/useChatContextActions.ts +++ b/src/hooks/useChatContextActions.ts @@ -1,12 +1,12 @@ import { useMemo } from '../lib/teact/teact'; -import { getActions } from '../modules'; +import { getActions } from '../global'; import { ApiChat, ApiUser } from '../api/types'; import { SERVICE_NOTIFICATIONS_USER_ID } from '../config'; import { isChatArchived, getCanDeleteChat, isUserId, isChatChannel, -} from '../modules/helpers'; +} from '../global/helpers'; import { compact } from '../util/iteratees'; import useLang from './useLang'; diff --git a/src/hooks/useEnsureMessage.ts b/src/hooks/useEnsureMessage.ts index 056c6ad6e..2f076071c 100644 --- a/src/hooks/useEnsureMessage.ts +++ b/src/hooks/useEnsureMessage.ts @@ -1,5 +1,5 @@ import { useEffect, useMemo } from '../lib/teact/teact'; -import { getActions } from '../modules'; +import { getActions } from '../global'; import { ApiMessage } from '../api/types'; diff --git a/src/hooks/useHistoryBack.ts b/src/hooks/useHistoryBack.ts index ccb309e60..78aae5e14 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 { getActions } from '../modules'; +import { getActions } from '../global'; import { areSortedArraysEqual } from '../util/iteratees'; type HistoryState = { diff --git a/src/hooks/useMessageMediaMetadata.ts b/src/hooks/useMessageMediaMetadata.ts index 9dc47c23b..2f104551c 100644 --- a/src/hooks/useMessageMediaMetadata.ts +++ b/src/hooks/useMessageMediaMetadata.ts @@ -8,7 +8,7 @@ import useMedia from './useMedia'; import { useAsync } from './useAsync'; import { getAudioHasCover, getChatAvatarHash, getChatTitle, getMessageContent, getMessageMediaHash, getSenderTitle, -} from '../modules/helpers'; +} from '../global/helpers'; import { getTranslation } from '../util/langProvider'; import { buildMediaMetadata } from '../util/mediaSession'; import { scaleImage, resizeImage } from '../util/imageResize'; diff --git a/src/hooks/useSendMessageAction.ts b/src/hooks/useSendMessageAction.ts index 3239f56ed..95b320d4d 100644 --- a/src/hooks/useSendMessageAction.ts +++ b/src/hooks/useSendMessageAction.ts @@ -1,5 +1,5 @@ import { useMemo } from '../lib/teact/teact'; -import { getActions } from '../modules'; +import { getActions } from '../global'; import { ApiSendMessageAction } from '../api/types'; diff --git a/src/hooks/useWebpThumbnail.ts b/src/hooks/useWebpThumbnail.ts index b5e440164..a78311eeb 100644 --- a/src/hooks/useWebpThumbnail.ts +++ b/src/hooks/useWebpThumbnail.ts @@ -5,7 +5,7 @@ import { ApiMessage } from '../api/types'; import { DEBUG } from '../config'; import { isWebpSupported } from '../util/environment'; import { EMPTY_IMAGE_DATA_URI, webpToPngBase64 } from '../util/webpToPng'; -import { getMessageMediaThumbDataUri } from '../modules/helpers'; +import { getMessageMediaThumbDataUri } from '../global/helpers'; export default function useWebpThumbnail(message?: ApiMessage) { const thumbDataUri = message && getMessageMediaThumbDataUri(message); diff --git a/src/index.tsx b/src/index.tsx index ce7db7d51..853355e51 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -4,8 +4,8 @@ import './util/setupServiceWorker'; import React from './lib/teact/teact'; import TeactDOM from './lib/teact/teact-dom'; -import { getActions, getGlobal } from './modules'; -import './global'; +import { getActions, getGlobal } from './global'; +import './global/init'; import { DEBUG } from './config'; diff --git a/src/modules/index.ts b/src/modules/index.ts deleted file mode 100644 index ebbde7ebb..000000000 --- a/src/modules/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -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 getActions = typed.getActions; -export const addActionHandler = typed.addActionHandler; -export const withGlobal = typed.withGlobal; diff --git a/src/util/audioPlayer.ts b/src/util/audioPlayer.ts index 3f5c3f6ed..15a276642 100644 --- a/src/util/audioPlayer.ts +++ b/src/util/audioPlayer.ts @@ -1,4 +1,4 @@ -import { getActions, getGlobal } from '../modules'; +import { getActions, getGlobal } from '../global'; import { AudioOrigin, GlobalSearchContent } from '../types'; import { ApiMessage } from '../api/types'; @@ -6,9 +6,9 @@ import { ApiMessage } from '../api/types'; import { IS_SAFARI } from './environment'; import safePlay from './safePlay'; import { patchSafariProgressiveAudio, isSafariPatchInProgress } from './patchSafariProgressiveAudio'; -import { getMessageKey, MessageKey, parseMessageKey } from '../modules/helpers'; +import { getMessageKey, MessageKey, parseMessageKey } from '../global/helpers'; import { fastRaf } from './schedulers'; -import { selectCurrentMessageList } from '../modules/selectors'; +import { selectCurrentMessageList } from '../global/selectors'; type Handler = (eventName: string, e: Event) => void; export type TrackId = `${MessageKey}-${number}`; diff --git a/src/util/deeplink.ts b/src/util/deeplink.ts index a5e062b0b..413adbe06 100644 --- a/src/util/deeplink.ts +++ b/src/util/deeplink.ts @@ -1,4 +1,4 @@ -import { getActions } from '../modules'; +import { getActions } from '../global'; 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 20e88314a..7aef6c0bb 100644 --- a/src/util/fastSmoothScroll.ts +++ b/src/util/fastSmoothScroll.ts @@ -1,4 +1,4 @@ -import { getGlobal } from '../modules'; +import { getGlobal } from '../global'; import { FocusDirection } from '../types'; diff --git a/src/util/fastSmoothScrollHorizontal.ts b/src/util/fastSmoothScrollHorizontal.ts index 0377284e0..9cc42ef62 100644 --- a/src/util/fastSmoothScrollHorizontal.ts +++ b/src/util/fastSmoothScrollHorizontal.ts @@ -1,4 +1,4 @@ -import { getGlobal } from '../modules'; +import { getGlobal } from '../global'; import { ANIMATION_LEVEL_MIN } from '../config'; import { animate } from './animation'; diff --git a/src/util/folderManager.ts b/src/util/folderManager.ts index 28a3d43d5..5e4a051ca 100644 --- a/src/util/folderManager.ts +++ b/src/util/folderManager.ts @@ -1,13 +1,13 @@ import { addCallback } from '../lib/teact/teactn'; -import { addActionHandler, getGlobal } from '../modules'; +import { addActionHandler, getGlobal } from '../global'; import { GlobalState } from '../global/types'; import { NotifyException, NotifySettings } from '../types'; import { ApiChat, ApiChatFolder, ApiUser } from '../api/types'; import { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, DEBUG } from '../config'; -import { selectNotifySettings, selectNotifyExceptions } from '../modules/selectors'; -import { selectIsChatMuted } from '../modules/helpers'; +import { selectNotifySettings, selectNotifyExceptions } from '../global/selectors'; +import { selectIsChatMuted } from '../global/helpers'; import { onIdle, throttle } from './schedulers'; import { areSortedArraysEqual, unique } from './iteratees'; import arePropsShallowEqual from './arePropsShallowEqual'; diff --git a/src/util/langProvider.ts b/src/util/langProvider.ts index 2b69abca1..5321194c2 100644 --- a/src/util/langProvider.ts +++ b/src/util/langProvider.ts @@ -1,4 +1,4 @@ -import { getGlobal } from '../modules'; +import { getGlobal } from '../global'; import { ApiLangPack, ApiLangString } from '../api/types'; import { LangCode, TimeFormat } from '../types'; diff --git a/src/util/notifications.ts b/src/util/notifications.ts index 45d7571a9..63f607da6 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 { getActions, getGlobal, setGlobal } from '../modules'; +import { getActions, getGlobal, setGlobal } from '../global'; import { getChatAvatarHash, getChatTitle, @@ -17,15 +17,15 @@ import { isChatChannel, selectIsChatMuted, selectShouldShowMessagePreview, -} from '../modules/helpers'; -import { addNotifyExceptions, replaceSettings } from '../modules/reducers'; +} from '../global/helpers'; +import { addNotifyExceptions, replaceSettings } from '../global/reducers'; import { selectChatMessage, selectCurrentMessageList, selectNotifyExceptions, selectNotifySettings, selectUser, -} from '../modules/selectors'; +} from '../global/selectors'; import { IS_SERVICE_WORKER_SUPPORTED, IS_TOUCH_ENV } from './environment'; import { getTranslation } from './langProvider'; import * as mediaLoader from './mediaLoader'; diff --git a/src/util/setupServiceWorker.ts b/src/util/setupServiceWorker.ts index ca8f99745..36815bbe5 100644 --- a/src/util/setupServiceWorker.ts +++ b/src/util/setupServiceWorker.ts @@ -1,5 +1,5 @@ import { DEBUG, DEBUG_MORE } from '../config'; -import { getActions } from '../modules'; +import { getActions } from '../global'; 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 1f85070ed..ddebbe1a6 100644 --- a/src/util/websync.ts +++ b/src/util/websync.ts @@ -1,5 +1,5 @@ import { APP_VERSION, DEBUG } from '../config'; -import { getGlobal } from '../modules'; +import { getGlobal } from '../global'; import { hasStoredSession } from './sessions'; const WEBSYNC_URLS = [