No longer necessary to remove id and change time to number
This commit is contained in:
@@ -12,12 +12,7 @@ import { getSettings, Settings } from '../utils/settings';
|
|||||||
import { getApiUrl } from '../utils/user';
|
import { getApiUrl } from '../utils/user';
|
||||||
|
|
||||||
import config, { ExtensionStatus } from '../config/config';
|
import config, { ExtensionStatus } from '../config/config';
|
||||||
import {
|
import { EntityType, Heartbeat, HeartbeatsBulkResponse } from '../types/heartbeats';
|
||||||
EntityType,
|
|
||||||
Heartbeat,
|
|
||||||
HeartbeatsBulkResponse,
|
|
||||||
HeartbeatThirdParty,
|
|
||||||
} from '../types/heartbeats';
|
|
||||||
|
|
||||||
class WakaTimeCore {
|
class WakaTimeCore {
|
||||||
tabsWithDevtoolsOpen: Tabs.Tab[];
|
tabsWithDevtoolsOpen: Tabs.Tab[];
|
||||||
@@ -190,19 +185,6 @@ class WakaTimeCore {
|
|||||||
const request: RequestInit = {
|
const request: RequestInit = {
|
||||||
body: JSON.stringify(
|
body: JSON.stringify(
|
||||||
heartbeats.map((heartbeat) => {
|
heartbeats.map((heartbeat) => {
|
||||||
if (!apiUrl.includes('wakatime.com')) {
|
|
||||||
const hb = {
|
|
||||||
branch: heartbeat.branch,
|
|
||||||
category: heartbeat.category,
|
|
||||||
entity: heartbeat.entity,
|
|
||||||
language: heartbeat.language,
|
|
||||||
plugin: heartbeat.plugin,
|
|
||||||
project: heartbeat.project,
|
|
||||||
time: parseFloat(heartbeat.time),
|
|
||||||
type: heartbeat.type,
|
|
||||||
} as HeartbeatThirdParty;
|
|
||||||
return { ...hb, userAgent };
|
|
||||||
}
|
|
||||||
return { ...heartbeat, userAgent };
|
return { ...heartbeat, userAgent };
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -10,10 +10,6 @@ export interface Heartbeat {
|
|||||||
type: EntityType;
|
type: EntityType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HeartbeatThirdParty extends Omit<Heartbeat, 'id' | 'time'> {
|
|
||||||
time: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum Category {
|
export enum Category {
|
||||||
browsing = 'browsing',
|
browsing = 'browsing',
|
||||||
code_reviewing = 'code reviewing',
|
code_reviewing = 'code reviewing',
|
||||||
|
|||||||
Reference in New Issue
Block a user