diff --git a/jest.config.js b/jest.config.js index 79c572eba..df92b7877 100644 --- a/jest.config.js +++ b/jest.config.js @@ -14,4 +14,7 @@ module.exports = { '\\.(jsx?|tsx?)$': 'babel-jest', '\\.txt$': 'jest-raw-loader', }, + globals: { + APP_REVISION: "jest-test", + }, }; diff --git a/src/api/gramjs/apiBuilders/statistics.ts b/src/api/gramjs/apiBuilders/statistics.ts index 786941c2c..90da66b6d 100644 --- a/src/api/gramjs/apiBuilders/statistics.ts +++ b/src/api/gramjs/apiBuilders/statistics.ts @@ -62,7 +62,7 @@ export function buildMessageStatistics(stats: GramJs.stats.MessageStats): ApiMes } export function buildGraph( - result: GramJs.TypeStatsGraph, isPercentage?: boolean + result: GramJs.TypeStatsGraph, isPercentage?: boolean, ): StatisticsGraph | undefined { if ((result as GramJs.StatsGraphError).error) { return undefined; diff --git a/src/components/left/main/LeftMainHeader.tsx b/src/components/left/main/LeftMainHeader.tsx index e59032608..5acb466c2 100644 --- a/src/components/left/main/LeftMainHeader.tsx +++ b/src/components/left/main/LeftMainHeader.tsx @@ -8,7 +8,14 @@ import { ApiChat } from '../../../api/types'; import { GlobalState } from '../../../global/types'; import { - ANIMATION_LEVEL_MAX, APP_NAME, APP_VERSION, BETA_CHANGELOG_URL, BETA_DISCUSSION_CHAT, DEBUG, FEEDBACK_URL, IS_BETA, + ANIMATION_LEVEL_MAX, + APP_NAME, APP_VERSION, + BETA_CHANGELOG_URL, + BETA_DISCUSSION_CHAT_EN, + BETA_DISCUSSION_CHAT_RU, + DEBUG, + FEEDBACK_URL, + IS_BETA, } from '../../../config'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; import buildClassName from '../../../util/buildClassName'; @@ -174,8 +181,12 @@ const LeftMainHeader: FC = ({ window.open(BETA_CHANGELOG_URL, '_blank'); }, []); - const handleDiscussionClick = useCallback(() => { - openChatByUsername({ username: BETA_DISCUSSION_CHAT }); + const handleRuDiscussionClick = useCallback(() => { + openChatByUsername({ username: BETA_DISCUSSION_CHAT_RU }); + }, [openChatByUsername]); + + const handleEnDiscussionClick = useCallback(() => { + openChatByUsername({ username: BETA_DISCUSSION_CHAT_EN }); }, [openChatByUsername]); const handleSwitchToWebK = useCallback(() => { @@ -268,10 +279,16 @@ const LeftMainHeader: FC = ({ Beta Discussion (ru) + + Beta Discussion (en) + )} {withOtherVersions && ( diff --git a/src/config.ts b/src/config.ts index ae8fa08ff..a8e4734ba 100644 --- a/src/config.ts +++ b/src/config.ts @@ -9,7 +9,8 @@ export const IS_PERF = process.env.APP_ENV === 'perf'; export const IS_BETA = process.env.APP_ENV === 'staging'; export const BETA_CHANGELOG_URL = 'https://telegra.ph/WebZ-Beta-04-01'; -export const BETA_DISCUSSION_CHAT = 'webzcommentsru'; +export const BETA_DISCUSSION_CHAT_RU = 'webzcommentsru'; +export const BETA_DISCUSSION_CHAT_EN = 'webzchat'; export const DEBUG_ALERT_MSG = 'Shoot!\nSomething went wrong, please see the error details in Dev Tools Console.'; export const DEBUG_GRAMJS = false;