fixed issue with tests. ES6 classes requires class vars to be established in the constructor

This commit is contained in:
Stephen Rodriguez
2015-06-10 14:45:09 -04:00
parent cdc1fe26f0
commit e37ce1496b
2 changed files with 19 additions and 14 deletions

View File

@@ -6,13 +6,15 @@ import devtools from './libs/devtools-detect.js';
class WakaTime {
detectionIntervalInSeconds = 60; //default
constructor(props) {
this.detectionIntervalInSeconds = 60; //default
loggingType = 'domain'; //default
this.loggingType = 'domain'; //default
heartbeatApiUrl = 'https://wakatime.com/api/v1/users/current/heartbeats';
this.heartbeatApiUrl = 'https://wakatime.com/api/v1/users/current/heartbeats';
currentUserApiUrl = 'https://wakatime.com/api/v1/users/current';
this.currentUserApiUrl = 'https://wakatime.com/api/v1/users/current';
}
/**
* Checks if the user is logged in.

View File

@@ -6,9 +6,11 @@ import changeExtensionIcon from '../helpers/changeExtensionIcon.js';
import WakaTimeOriginal from '../WakaTime.js';
class WakaTime extends React.Component {
logoutUserUrl = 'https://wakatime.com/logout';
state = {
constructor(props) {
super(props);
this.logoutUserUrl = 'https://wakatime.com/logout';
this.state = {
user: {
full_name: null,
email: null,
@@ -16,7 +18,8 @@ class WakaTime extends React.Component {
},
loggedIn: false,
loggingEnabled: false
};
}
}
componentDidMount() {