Skip to content

Commit

Permalink
No longer necessary to remove id and change time to number
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhamlett committed Oct 14, 2024
1 parent 89c4249 commit 27c863b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
20 changes: 1 addition & 19 deletions src/core/WakaTimeCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ import { getSettings, Settings } from '../utils/settings';
import { getApiUrl } from '../utils/user';

import config, { ExtensionStatus } from '../config/config';
import {
EntityType,
Heartbeat,
HeartbeatsBulkResponse,
HeartbeatThirdParty,
} from '../types/heartbeats';
import { EntityType, Heartbeat, HeartbeatsBulkResponse } from '../types/heartbeats';

class WakaTimeCore {
tabsWithDevtoolsOpen: Tabs.Tab[];
Expand Down Expand Up @@ -190,19 +185,6 @@ class WakaTimeCore {
const request: RequestInit = {
body: JSON.stringify(
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 };
}),
),
Expand Down
4 changes: 0 additions & 4 deletions src/types/heartbeats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ export interface Heartbeat {
type: EntityType;
}

export interface HeartbeatThirdParty extends Omit<Heartbeat, 'id' | 'time'> {
time: number;
}

export enum Category {
browsing = 'browsing',
code_reviewing = 'code reviewing',
Expand Down

0 comments on commit 27c863b

Please sign in to comment.