Skip to content

Commit

Permalink
The package.json version is began to be used as an env variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
nurullah authored Feb 28, 2022
1 parent 2f372ab commit e80b969
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
REACT_APP_VERSION=$npm_package_version

REACT_APP_TELEGRAM_API_ID=
REACT_APP_TELEGRAM_API_HASH=
3 changes: 1 addition & 2 deletions public/custom-service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/Components/ColumnLeft/Settings/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -115,7 +114,7 @@ class Main extends React.Component {
<ListItemText primary={t('Language')} />
</ListItem>
<div className='settings-main-footer'>
{packageJson.version}
{process.env.REACT_APP_VERSION}
</div>
</div>
</>
Expand Down
3 changes: 1 addition & 2 deletions src/Components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
*/

import React from 'react';
import packageJson from '../../package.json';
import './Footer.css';

class Footer extends React.PureComponent {
render() {
return (
<div className='footer-wrapper'>
<span>{packageJson.version}</span>
<span>{process.env.REACT_APP_VERSION}</span>
</div>
);
}
Expand Down
4 changes: 1 addition & 3 deletions src/Controllers/TdLibController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -210,7 +209,6 @@ class TdLibController extends EventEmitter {
}

const { useTestDC } = this.parameters;
const { version } = packageJson;

this.send({
'@type': 'setTdlibParameters',
Expand All @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/TelegramApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit e80b969

Please sign in to comment.