Skip to content

Commit 6285403

Browse files
authored
preferences usage and code cleanup (#496)
1 parent 9cf6dd5 commit 6285403

File tree

7 files changed

+2
-47
lines changed

7 files changed

+2
-47
lines changed

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "swdc-vscode",
33
"displayName": "Code Time",
4-
"version": "2.7.11",
4+
"version": "2.7.12",
55
"publisher": "softwaredotcom",
66
"description": "Code Time is an open source plugin that provides programming metrics right in Visual Studio Code.",
77
"author": {
@@ -76,10 +76,6 @@
7676
"command": "codetime.registerAccount",
7777
"title": "Code Time: Sign up"
7878
},
79-
{
80-
"command": "codetime.disconnectSlackWorkspace",
81-
"title": "Code Time: Disconnect Slack workspace"
82-
},
8379
{
8480
"command": "codetime.connectSlack",
8581
"title": "Code Time: Connect Slack workspace"

src/DataController.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,7 @@ export function isRegistered() {
3838
export async function getUserPreferences() {
3939
currentUser = await getCachedUser()
4040
if (currentUser) {
41-
let prefs = currentUser.preferences;
42-
if (prefs && typeof prefs === 'string') {
43-
try {
44-
return JSON.parse(prefs);
45-
} catch (e: any) {
46-
logIt(`Error parsing preferences: ${e.message}`, true);
47-
}
48-
}
41+
return currentUser.preferences_parsed;
4942
}
5043
return {}
5144
}

src/command-helper.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,6 @@ export function createCommands(
152152
})
153153
);
154154

155-
cmds.push(
156-
commands.registerCommand('codetime.disconnectSlackWorkspace', (auth_id: any) => {
157-
launchWebUrl(`${app_url}/data_sources/integration_types/slack`);
158-
})
159-
);
160-
161155
cmds.push(
162156
commands.registerCommand('codetime.enableFlowMode', () => {
163157
enableFlow({automated: false});

src/managers/ProgressManager.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,6 @@ export class ProgressManager {
1616

1717
return ProgressManager.instance;
1818
}
19-
20-
reportProgress(progress: any, increment: number): void {
21-
if (this.doneWriting) {
22-
return;
23-
}
24-
25-
if (increment < 80) {
26-
increment += 10;
27-
} else if (increment < 90) {
28-
increment += 1;
29-
}
30-
31-
increment = Math.min(90, increment);
32-
33-
setTimeout(() => {
34-
progress.report({increment});
35-
this.reportProgress(progress, increment);
36-
}, 450);
37-
}
3819
}
3920

4021
export function progressIt(msg: string, asyncFunc: any, args: any[] = []) {

src/managers/SyncManger.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ import { commands } from 'vscode';
55

66
const fs = require('fs');
77

8-
const thirty_seconds: number = 1000 * 30;
9-
10-
export function passedThreshold(now_in_millis: number, synced_val: number) {
11-
if (!synced_val || now_in_millis - synced_val > thirty_seconds) {
12-
return true;
13-
}
14-
return false;
15-
}
16-
178
export class SyncManager {
189
private static _instance: SyncManager;
1910

swdc-vscode-2.7.11.vsix

-580 KB
Binary file not shown.

swdc-vscode-2.7.12.vsix

579 KB
Binary file not shown.

0 commit comments

Comments
 (0)