Naming adjustments
This commit is contained in:
@@ -186,12 +186,12 @@ class WakaTimeCore {
|
|||||||
* @returns {*}
|
* @returns {*}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_preparePayload(entity, type, debug = false) {
|
_preparePayload(heartbeat, type, debug = false) {
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
entity: entity.url,
|
entity: heartbeat.url,
|
||||||
type: type,
|
type: type,
|
||||||
time: moment().format('X'),
|
time: moment().format('X'),
|
||||||
project: entity.project || '<<LAST_PROJECT>>',
|
project: heartbeat.project || '<<LAST_PROJECT>>',
|
||||||
is_debugging: debug,
|
is_debugging: debug,
|
||||||
plugin: 'chrome-wakatime/' + config.version
|
plugin: 'chrome-wakatime/' + config.version
|
||||||
});
|
});
|
||||||
@@ -223,21 +223,21 @@ class WakaTimeCore {
|
|||||||
* @param entity
|
* @param entity
|
||||||
* @param debug
|
* @param debug
|
||||||
*/
|
*/
|
||||||
sendHeartbeat(entity, debug) {
|
sendHeartbeat(heartbeat, debug) {
|
||||||
var payload = null;
|
var payload = null;
|
||||||
|
|
||||||
this._getLoggingType().done((loggingType) => {
|
this._getLoggingType().done((loggingType) => {
|
||||||
// Get only the domain from the entity.
|
// Get only the domain from the entity.
|
||||||
// And send that in heartbeat
|
// And send that in heartbeat
|
||||||
if (loggingType == 'domain') {
|
if (loggingType == 'domain') {
|
||||||
entity.url = getDomainFromUrl(entity.url);
|
heartbeat.url = getDomainFromUrl(heartbeat.url);
|
||||||
payload = this._preparePayload(entity, 'domain', debug);
|
payload = this._preparePayload(heartbeat, 'domain', debug);
|
||||||
console.log(payload);
|
console.log(payload);
|
||||||
this.sendAjaxRequestToApi(payload);
|
this.sendAjaxRequestToApi(payload);
|
||||||
}
|
}
|
||||||
// Send entity in heartbeat
|
// Send entity in heartbeat
|
||||||
else if (loggingType == 'url') {
|
else if (loggingType == 'url') {
|
||||||
payload = this._preparePayload(entity, 'url', debug);
|
payload = this._preparePayload(heartbeat, 'url', debug);
|
||||||
console.log(payload);
|
console.log(payload);
|
||||||
this.sendAjaxRequestToApi(payload);
|
this.sendAjaxRequestToApi(payload);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user