Compare versions for "Update Telegram" button (follow-up)

This commit is contained in:
Alexander Zinchuk 2022-09-12 13:29:19 +02:00
parent edab6ebac8
commit be9cdd906d
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,6 @@ 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 APP_VERSION_URL_PATH = '/version.txt';
export const DEBUG_ALERT_MSG = 'Shoot!\nSomething went wrong, please see the error details in Dev Tools Console.';
export const DEBUG_GRAMJS = false;

View File

@ -2,13 +2,14 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index';
import type { ApiError } from '../../../api/types';
import { APP_VERSION, APP_VERSION_URL_PATH, GLOBAL_STATE_CACHE_CUSTOM_EMOJI_LIMIT } from '../../../config';
import { APP_VERSION, GLOBAL_STATE_CACHE_CUSTOM_EMOJI_LIMIT } from '../../../config';
import { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../../util/environment';
import getReadableErrorText from '../../../util/getReadableErrorText';
import { selectChatMessage, selectCurrentMessageList, selectIsTrustedBot } from '../../selectors';
import generateIdFor from '../../../util/generateIdFor';
import { unique } from '../../../util/iteratees';
export const APP_VERSION_URL = 'version.txt';
const MAX_STORED_EMOJIS = 8 * 4; // Represents four rows of recent emojis
addActionHandler('toggleChatInfo', (global, action, payload) => {
@ -407,7 +408,7 @@ addActionHandler('updateLastRenderedCustomEmojis', (global, actions, payload) =>
addActionHandler('checkAppVersion', () => {
const APP_VERSION_REGEX = /^\d+\.\d+(\.\d+)?$/;
fetch(APP_VERSION_URL_PATH)
fetch(APP_VERSION_URL)
.then((response) => {
return response.text();
}).then((version) => {