fixed issue with tests. ES6 classes requires class vars to be established in the constructor
This commit is contained in:
@@ -6,13 +6,15 @@ import devtools from './libs/devtools-detect.js';
|
|||||||
|
|
||||||
class WakaTime {
|
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.
|
* Checks if the user is logged in.
|
||||||
|
|||||||
@@ -6,17 +6,20 @@ import changeExtensionIcon from '../helpers/changeExtensionIcon.js';
|
|||||||
import WakaTimeOriginal from '../WakaTime.js';
|
import WakaTimeOriginal from '../WakaTime.js';
|
||||||
|
|
||||||
class WakaTime extends React.Component {
|
class WakaTime extends React.Component {
|
||||||
logoutUserUrl = 'https://wakatime.com/logout';
|
|
||||||
|
|
||||||
state = {
|
constructor(props) {
|
||||||
user: {
|
super(props);
|
||||||
full_name: null,
|
this.logoutUserUrl = 'https://wakatime.com/logout';
|
||||||
email: null,
|
this.state = {
|
||||||
photo: null
|
user: {
|
||||||
},
|
full_name: null,
|
||||||
loggedIn: false,
|
email: null,
|
||||||
loggingEnabled: false
|
photo: null
|
||||||
};
|
},
|
||||||
|
loggedIn: false,
|
||||||
|
loggingEnabled: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user