diff --git a/.env b/.env index bed8bdca7..09ba09af7 100644 --- a/.env +++ b/.env @@ -1,2 +1,4 @@ +REACT_APP_VERSION=$npm_package_version + REACT_APP_TELEGRAM_API_ID= REACT_APP_TELEGRAM_API_HASH= diff --git a/public/custom-service-worker.js b/public/custom-service-worker.js index fa45a20e6..0a20d737e 100644 --- a/public/custom-service-worker.js +++ b/public/custom-service-worker.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ // import TdClient from 'tdweb/dist/tdweb'; -// import packageJson from '../package'; // importScripts('./tdweb.js'); // importScripts('./subworkers.js'); @@ -272,7 +271,7 @@ self.addEventListener('message', async e => { // // system_language_code: 'en', // // device_model: 'Web', // // system_version: 'Unknown', -// // application_version: '0.0.1',//packageJson.version, +// // application_version: '0.0.1',//process.env.REACT_APP_VERSION, // // use_secret_chats: false, // // use_message_database: true, // // use_file_database: false, diff --git a/src/Components/ColumnLeft/Settings/Main.js b/src/Components/ColumnLeft/Settings/Main.js index 17e0aa01e..2b2da0efc 100644 --- a/src/Components/ColumnLeft/Settings/Main.js +++ b/src/Components/ColumnLeft/Settings/Main.js @@ -22,7 +22,6 @@ import SettingsMenuButton from './SettingsMenuButton'; import UnmuteIcon from '../../../Assets/Icons/Unmute'; import DataIcon from '../../../Assets/Icons/Data'; import LanguageIcon from '../../../Assets/Icons/Language'; -import packageJson from '../../../../package.json'; import { setProfileMediaViewerContent } from '../../../Actions/Client'; import ChatStore from '../../../Stores/ChatStore'; import './Main.css'; @@ -115,7 +114,7 @@ class Main extends React.Component {
- {packageJson.version} + {process.env.REACT_APP_VERSION}
diff --git a/src/Components/Footer.js b/src/Components/Footer.js index 742515205..a68d8d333 100644 --- a/src/Components/Footer.js +++ b/src/Components/Footer.js @@ -6,14 +6,13 @@ */ import React from 'react'; -import packageJson from '../../package.json'; import './Footer.css'; class Footer extends React.PureComponent { render() { return (
- {packageJson.version} + {process.env.REACT_APP_VERSION}
); } diff --git a/src/Controllers/TdLibController.js b/src/Controllers/TdLibController.js index 2932964d5..ea0a97fdd 100644 --- a/src/Controllers/TdLibController.js +++ b/src/Controllers/TdLibController.js @@ -6,7 +6,6 @@ */ import EventEmitter from '../Stores/EventEmitter'; -import packageJson from '../../package.json'; import { stringToBoolean, getBrowser, getOSName } from '../Utils/Common'; import { DATABASE_NAME, DATABASE_TEST_NAME, @@ -210,7 +209,6 @@ class TdLibController extends EventEmitter { } const { useTestDC } = this.parameters; - const { version } = packageJson; this.send({ '@type': 'setTdlibParameters', @@ -222,7 +220,7 @@ class TdLibController extends EventEmitter { system_language_code: navigator.language || 'en', device_model: getBrowser(), system_version: getOSName(), - application_version: version, + application_version: process.env.REACT_APP_VERSION, use_secret_chats: false, use_message_database: true, use_file_database: false, diff --git a/src/TelegramApp.js b/src/TelegramApp.js index 6888fa016..dfb6a7a57 100644 --- a/src/TelegramApp.js +++ b/src/TelegramApp.js @@ -17,7 +17,6 @@ import DialogActions from '@material-ui/core/DialogActions'; import DialogContent from '@material-ui/core/DialogContent'; import DialogContentText from '@material-ui/core/DialogContentText'; import DialogTitle from '@material-ui/core/DialogTitle'; -import packageJson from '../package.json'; import AuthForm from './Components/Auth/AuthForm'; import InactivePage from './Components/InactivePage'; import NativeAppPage from './Components/NativeAppPage'; @@ -46,7 +45,7 @@ class TelegramApp extends Component { constructor(props) { super(props); - console.log(`Start Telegram Web ${packageJson.version}`); + console.log(`Start Telegram Web ${process.env.REACT_APP_VERSION}`); console.log('[auth] ctor', props.location); this.state = {