Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The package.json version is began to be used as an env variable. #428

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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