diff --git a/src/components/left/settings/SettingsGeneral.tsx b/src/components/left/settings/SettingsGeneral.tsx index 002ea7577..cc662c479 100644 --- a/src/components/left/settings/SettingsGeneral.tsx +++ b/src/components/left/settings/SettingsGeneral.tsx @@ -4,7 +4,8 @@ import { } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import type { SharedSettings, ThemeKey, TimeFormat } from '../../../types'; +import type { SharedSettings } from '../../../global/types'; +import type { ThemeKey, TimeFormat } from '../../../types'; import type { IRadioOption } from '../../ui/RadioGroup'; import { SettingsScreens } from '../../../types'; diff --git a/src/components/left/settings/SettingsLanguage.tsx b/src/components/left/settings/SettingsLanguage.tsx index 606945242..1e1721840 100644 --- a/src/components/left/settings/SettingsLanguage.tsx +++ b/src/components/left/settings/SettingsLanguage.tsx @@ -4,7 +4,8 @@ import { } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import type { AccountSettings, LangCode, SharedSettings } from '../../../types'; +import type { SharedSettings } from '../../../global/types'; +import type { AccountSettings, LangCode } from '../../../types'; import { SettingsScreens } from '../../../types'; import { selectIsCurrentUserPremium } from '../../../global/selectors'; diff --git a/src/components/middle/composer/MessageInput.tsx b/src/components/middle/composer/MessageInput.tsx index 1010274be..50e6ea3f1 100644 --- a/src/components/middle/composer/MessageInput.tsx +++ b/src/components/middle/composer/MessageInput.tsx @@ -9,8 +9,9 @@ import { import { getActions, withGlobal } from '../../../global'; import type { ApiInputMessageReplyInfo } from '../../../api/types'; +import type { SharedSettings } from '../../../global/types'; import type { - IAnchorPosition, MessageListType, SharedSettings, ThreadId, + IAnchorPosition, MessageListType, ThreadId, } from '../../../types'; import type { Signal } from '../../../util/signals'; diff --git a/src/global/types/sharedState.ts b/src/global/types/sharedState.ts index b244e5227..33258ecb9 100644 --- a/src/global/types/sharedState.ts +++ b/src/global/types/sharedState.ts @@ -1,35 +1,30 @@ import type { ApiLanguage } from '../../api/types'; -import type { - AnimationLevel, - PerformanceType, - Point, - Size, - ThemeKey, - TimeFormat, -} from '../../types'; +import type { AnimationLevel, PerformanceType, Point, Size, ThemeKey, TimeFormat } from '../../types'; -export type SharedState = { - settings: { - shouldUseSystemTheme: boolean; - theme: ThemeKey; - language: string; - languages?: ApiLanguage[]; - performance: PerformanceType; - messageTextSize: number; - animationLevel: AnimationLevel; - messageSendKeyCombo: 'enter' | 'ctrl-enter'; - miniAppsCachedPosition?: Point; - miniAppsCachedSize?: Size; - timeFormat: TimeFormat; - wasTimeFormatSetManually: boolean; - isConnectionStatusMinimized: boolean; - canDisplayChatInTitle: boolean; - shouldForceHttpTransport?: boolean; - shouldAllowHttpTransport?: boolean; - shouldCollectDebugLogs?: boolean; - shouldDebugExportedSenders?: boolean; - shouldWarnAboutSvg?: boolean; - shouldSkipWebAppCloseConfirmation: boolean; - }; +export interface SharedState { + settings: SharedSettings; isInitial?: true; -}; +} + +export interface SharedSettings { + shouldUseSystemTheme: boolean; + theme: ThemeKey; + language: string; + languages?: ApiLanguage[]; + performance: PerformanceType; + messageTextSize: number; + animationLevel: AnimationLevel; + messageSendKeyCombo: 'enter' | 'ctrl-enter'; + miniAppsCachedPosition?: Point; + miniAppsCachedSize?: Size; + timeFormat: TimeFormat; + wasTimeFormatSetManually: boolean; + isConnectionStatusMinimized: boolean; + canDisplayChatInTitle: boolean; + shouldForceHttpTransport?: boolean; + shouldAllowHttpTransport?: boolean; + shouldCollectDebugLogs?: boolean; + shouldDebugExportedSenders?: boolean; + shouldWarnAboutSvg?: boolean; + shouldSkipWebAppCloseConfirmation: boolean; +} diff --git a/src/types/index.ts b/src/types/index.ts index a2820aecf..38316b3d9 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -18,7 +18,6 @@ import type { ApiInputReplyInfo, ApiInputSuggestedPostInfo, ApiLabeledPrice, - ApiLanguage, ApiMediaFormat, ApiMessage, ApiMessageEntity, @@ -160,34 +159,6 @@ export interface AccountSettings { shouldPaidMessageAutoApprove: boolean; } -export interface SharedSettings { - shouldUseSystemTheme: boolean; - theme: ThemeKey; - themes: Partial>; - language: string; - languages?: ApiLanguage[]; - performance: PerformanceType; - messageTextSize: number; - animationLevel: AnimationLevel; - messageSendKeyCombo: 'enter' | 'ctrl-enter'; - miniAppsCachedPosition?: Point; - miniAppsCachedSize?: Size; - timeFormat: TimeFormat; - wasTimeFormatSetManually: boolean; - isConnectionStatusMinimized: boolean; - canDisplayChatInTitle: boolean; - shouldForceHttpTransport?: boolean; - shouldAllowHttpTransport?: boolean; - shouldCollectDebugLogs?: boolean; - shouldDebugExportedSenders?: boolean; - shouldWarnAboutSvg?: boolean; - shouldSkipWebAppCloseConfirmation: boolean; - hasContactJoinedNotifications?: boolean; - hasWebNotifications: boolean; - hasPushNotifications: boolean; - notificationSoundVolume: number; -} - export type IAnchorPosition = { x: number; y: number;